Skip to content

Commit

Permalink
Github - actions
Browse files Browse the repository at this point in the history
  • Loading branch information
pekral committed May 31, 2020
1 parent 58b909b commit e4f1cf4
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 14 deletions.
21 changes: 12 additions & 9 deletions .github/workflows/php.yml → .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,18 @@ jobs:

runs-on: ubuntu-latest

strategy:
matrix:
php-version:
- "7.1"
- "7.2"
- "7.3"
- "7.4"

steps:
- uses: actions/checkout@v2
- name: "Checkout"
uses: "actions/checkout@v2"

- name: Validate composer.json and composer.lock
run: composer validate

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
Expand All @@ -30,8 +36,5 @@ jobs:
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer install --prefer-dist --no-progress --no-suggest

# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit"
# Docs: https://getcomposer.org/doc/articles/scripts.md

# - name: Run test suite
# run: composer run-script test
- name: "Phing - app check"
run: "vendor/bin/phing"
22 changes: 19 additions & 3 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
<!-- ============================================ -->
<!-- Target: check -->
<!-- ============================================ -->
<target name="check">
<exec command="php vendor/bin/phpcs --standard=ruleset.xml --extensions=php --encoding=utf-8 src" passthru="true" checkreturn="true"/>
<phingcall target="phpstan"/>
<target name="check" depends="lint, phpcs, phpstan, tests">
<exec command="vendor/bin/phpunit tests" checkreturn="true" passthru="true"/>
</target>
<!-- ============================================ -->
Expand All @@ -21,4 +19,22 @@
<target name="phpstan">
<exec command="php -d memory_limit=8G vendor/bin/phpstan analyse src/ -c phpstan.neon --no-progress" passthru="true" checkreturn="true" level="error"/>
</target>
<!-- ============================================ -->
<!-- Target: lint -->
<!-- ============================================ -->
<target name="lint">
<exec command="vendor/bin/parallel-lint src --exclude vendor" passthru="true" checkreturn="true" level="error"/>
</target>
<!-- ============================================ -->
<!-- Target: phpcs -->
<!-- ============================================ -->
<target name="phpcs">
<exec command="php vendor/bin/phpcs --standard=ruleset.xml --extensions=php --encoding=utf-8 src" passthru="true" checkreturn="true"/>
</target>
<!-- ============================================ -->
<!-- Target: tests -->
<!-- ============================================ -->
<target name="tests">
<exec command="vendor/bin/phpunit tests" passthru="true" checkreturn="true" level="error"/>
</target>
</project>
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"fzaninotto/faker": "^1.7",
"phpstan/phpstan": "^0.12.3",
"mockery/mockery": "^1.3",
"sllh/composer-versions-check": "^2.0"
"sllh/composer-versions-check": "^2.0",
"php-parallel-lint/php-parallel-lint": "^1.2"
},
"autoload": {
"psr-4": {
Expand Down
55 changes: 54 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e4f1cf4

Please sign in to comment.