Skip to content

Commit

Permalink
Improve QA workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
gmazzap committed Feb 19, 2021
1 parent 36b4412 commit 63284de
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 25 deletions.
47 changes: 33 additions & 14 deletions .github/workflows/qa.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,50 @@
name: PHP Quality Assurance
on: [push]
on: [push, pull_request]
jobs:
build:
tests:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'ci skip')"
strategy:
fail-fast: true
matrix:
php-versions: ['7.1', '7.2', '7.3', '7.4']
php-versions: ['7.1', '7.2', '7.3', '7.4', '8.0']
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}

- name: Check syntax error in sources
run: find ./src/ ./tests/ -type f -name '*.php' -print0 | xargs -0 -L 1 -P 4 -- php -l

- name: Install dependencies
uses: "ramsey/composer-install@v1"

- name: Run unit tests
run: composer tests:no-cov

static:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'ci skip')"
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}

- name: Check syntax error in sources
run: find ./src/ ./tests/ -type f -name '*.php' -print0 | xargs -0 -L 1 -P 4 -- php -l
php-version: 7.4

- name: Install dependencies
run: composer install -q -n -a --no-progress --prefer-dist

- name: Run unit tests
run: ./vendor/bin/phpunit --no-coverage
uses: "ramsey/composer-install@v1"

- name: Check code styles
run: ./vendor/bin/phpcs
run: composer cs

- name: Check Psalm
run: ./vendor/bin/psalm --show-info=false --no-progress --output-format=compact
run: composer psalm

- name: Check cross-version PHP compatibility
run: composer phpcompat
2 changes: 2 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@
"psalm": "@php ./vendor/vimeo/psalm/psalm",
"tests": "@php ./vendor/phpunit/phpunit/phpunit",
"tests:no-cov": "@php ./vendor/phpunit/phpunit/phpunit --no-coverage",
"phpcompat": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcs -p . --standard=PHPCompatibility --ignore=*/vendor/* --extensions=php --basepath=./ --runtime-set testVersion 7.1-",
"qa": [
"@cs",
"@phpcompat",
"@psalm",
"@tests:no-cov"
]
Expand Down
11 changes: 0 additions & 11 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,12 @@
<psalm
autoloader="./.psalm/autoloader.php"
totallyTyped="true"
useDocblockTypes="true"
useDocblockPropertyTypes="true"
usePhpDocMethodsWithoutMagicCall="true"
strictBinaryOperands="true"
requireVoidReturnType="true"
useAssertForType="true"
rememberPropertyAssignmentsAfterCall="true"
allowPhpStormGenerics="true"
allowStringToStandInForClass="false"
memoizeMethodCallResults="false"
hoistConstants="false"
addParamDefaultToDocblockType="false"
checkForThrowsInGlobalScope="false"
ignoreInternalFunctionFalseReturn="false"
ignoreInternalFunctionNullReturn="false"
hideExternalErrors="true"
allowFileIncludes="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
Expand Down

0 comments on commit 63284de

Please sign in to comment.