这是indexloc提供的服务,不要输入任何密码
Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Build

on:
push:
branches: [master]
pull_request:
release:
types: [created]
schedule:
- cron: '0 4 * * *'

jobs:
tests:
runs-on: ubuntu-latest
name: Build and test
strategy:
matrix:
php: [7.2, 7.3, 7.4]
deps: [high]
include:
- php: 7.2
deps: low
container:
image: docker://jakzal/phpqa:php${{ matrix.php }}-alpine
steps:
- uses: actions/checkout@master
- if: matrix.deps == 'high'
run: make install test package package-devkit
- if: matrix.deps == 'low'
run: make update-min test-min
- uses: actions/upload-artifact@v1
if: matrix.php == '7.2' && matrix.deps == 'high'
with:
name: toolbox.phar
path: build/toolbox.phar
- uses: actions/upload-artifact@v1
if: matrix.php == '7.2' && matrix.deps == 'high'
with:
name: devkit.phar
path: build/devkit.phar
integration-tests:
runs-on: ubuntu-latest
name: Run integration tests
needs: tests
strategy:
matrix:
php: [7.2, 7.3, 7.4]
container:
image: docker://jakzal/phpqa:php${{ matrix.php }}-alpine
steps:
- uses: actions/checkout@master
- uses: actions/download-artifact@v1
with:
name: toolbox.phar
path: build/
- run: make test-integration
26 changes: 26 additions & 0 deletions .github/workflows/publish-website.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Publish the website

on:
push:
branches: [master]
release:
types: [created]

jobs:
publish-website:
runs-on: ubuntu-latest
name: Build and publish
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false
- name: Build the website
uses: docker://jakzal/phpqa:alpine
with:
args: make package-devkit website
- name: Publish the website
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
BRANCH: gh-pages
FOLDER: build/website
23 changes: 23 additions & 0 deletions .github/workflows/update-phars.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Update PHARs

on:
push:
branches: [master]
pull_request:
release:
types: [created]

jobs:
update-phars:
runs-on: ubuntu-latest
name: Create a PR
steps:
- uses: actions/checkout@v2
- uses: geertvdc/setup-hub@master
- run: git config user.email 'jakub@zalas.pl' && git config user.name 'Jakub Zalas'
- uses: docker://jakzal/phpqa:alpine
with:
args: make package-devkit update-phars
- run: "hub pull-request -h tools-update -a jakzal -m 'Update tools' -m '' -m ':robot: This pull request was automagically sent from Github'"
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
22 changes: 11 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@ test: vendor cs deptrac phpunit infection
test-min: update-min cs deptrac phpunit infection
.PHONY: test-min

test-integration: package
test-integration: build/toolbox.phar
rm -rf ./build/tools && \
export PATH="$(shell pwd)/build/tools:$(shell pwd)/build/tools/.composer/vendor/bin:$(shell pwd)/build/tools/QualityAnalyzer/bin:$(shell pwd)/build/tools/EasyCodingStandard/bin:$$PATH" && \
export COMPOSER_HOME=$(shell pwd)/build/tools/.composer && \
ls -l build && whoami && \
chmod +x build/toolbox.phar && \
mkdir -p ./build/tools && \
build/toolbox.phar install --target-dir ./build/tools --exclude-tag exclude-php:$(PHP_VERSION) && \
Expand Down Expand Up @@ -93,10 +94,10 @@ package-devkit: tools/box
@rm -rf build/devkit-phar
.PHONY: package-devkit

website:
website: build/devkit.phar
rm -rf build/website
mkdir -p build/website
php bin/devkit.php generate:html > build/website/index.html
php build/devkit.phar generate:html > build/website/index.html
touch build/website/.nojekyll
.PHONY: website

Expand All @@ -108,16 +109,15 @@ publish-website: website
git push --force --quiet "https://github.com/jakzal/toolbox.git" master:gh-pages
.PHONY: publish-website

update-phars:
update-phars: vendor
php bin/devkit.php update:phars
git diff --exit-code resources/ || \
( \
git checkout -b tools-update && \
git add resources/*.json && \
git commit -m "Update tools" && \
git push origin tools-update && \
hub pull-request -h tools-update -a jakzal -m 'Update tools' -m '' -m ':robot: This pull request was automagically sent from [Travis CI]('$(TRAVIS_BUILD_WEB_URL)').' \
)
( \
git checkout -b tools-update && \
git add resources/*.json && \
git commit -m "Update tools" && \
git push origin tools-update \
)
.PHONY: update-phars

tools: tools/php-cs-fixer tools/deptrac tools/infection tools/box
Expand Down
2 changes: 1 addition & 1 deletion bin/devkit.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ protected function configure()

protected function execute(InputInterface $input, OutputInterface $output)
{
$tools = $this->loadTools($input->getOption('tools'), new Filter([\Zalas\Toolbox\UseCase\InstallTools::PRE_INSTALLATION_TAG], []));
$tools = $this->loadTools($input->getOption('tools'), new Filter(['pre-installation'], []));

$output->writeln($this->renderPage($tools->map($this->toolToHtml())));

Expand Down