Skip to content

Commit 63284de

Browse files
committed
Improve QA workflow
1 parent 36b4412 commit 63284de

File tree

3 files changed

+35
-25
lines changed

3 files changed

+35
-25
lines changed

.github/workflows/qa.yml

Lines changed: 33 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,50 @@
11
name: PHP Quality Assurance
2-
on: [push]
2+
on: [push, pull_request]
33
jobs:
4-
build:
4+
tests:
55
runs-on: ubuntu-latest
66
if: "!contains(github.event.head_commit.message, 'ci skip')"
77
strategy:
8+
fail-fast: true
89
matrix:
9-
php-versions: ['7.1', '7.2', '7.3', '7.4']
10+
php-versions: ['7.1', '7.2', '7.3', '7.4', '8.0']
1011
steps:
11-
- uses: actions/checkout@v2
12+
- uses: actions/checkout@v2
13+
14+
- name: Setup PHP
15+
uses: shivammathur/setup-php@v2
16+
with:
17+
php-version: ${{ matrix.php-versions }}
18+
19+
- name: Check syntax error in sources
20+
run: find ./src/ ./tests/ -type f -name '*.php' -print0 | xargs -0 -L 1 -P 4 -- php -l
21+
22+
- name: Install dependencies
23+
uses: "ramsey/composer-install@v1"
24+
25+
- name: Run unit tests
26+
run: composer tests:no-cov
27+
28+
static:
29+
runs-on: ubuntu-latest
30+
if: "!contains(github.event.head_commit.message, 'ci skip')"
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v2
1234

1335
- name: Setup PHP
1436
uses: shivammathur/setup-php@v2
1537
with:
16-
php-version: ${{ matrix.php-versions }}
17-
18-
- name: Check syntax error in sources
19-
run: find ./src/ ./tests/ -type f -name '*.php' -print0 | xargs -0 -L 1 -P 4 -- php -l
38+
php-version: 7.4
2039

2140
- name: Install dependencies
22-
run: composer install -q -n -a --no-progress --prefer-dist
23-
24-
- name: Run unit tests
25-
run: ./vendor/bin/phpunit --no-coverage
41+
uses: "ramsey/composer-install@v1"
2642

2743
- name: Check code styles
28-
run: ./vendor/bin/phpcs
44+
run: composer cs
2945

3046
- name: Check Psalm
31-
run: ./vendor/bin/psalm --show-info=false --no-progress --output-format=compact
47+
run: composer psalm
48+
49+
- name: Check cross-version PHP compatibility
50+
run: composer phpcompat

composer.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,10 @@
4444
"psalm": "@php ./vendor/vimeo/psalm/psalm",
4545
"tests": "@php ./vendor/phpunit/phpunit/phpunit",
4646
"tests:no-cov": "@php ./vendor/phpunit/phpunit/phpunit --no-coverage",
47+
"phpcompat": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcs -p . --standard=PHPCompatibility --ignore=*/vendor/* --extensions=php --basepath=./ --runtime-set testVersion 7.1-",
4748
"qa": [
4849
"@cs",
50+
"@phpcompat",
4951
"@psalm",
5052
"@tests:no-cov"
5153
]

psalm.xml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,12 @@
22
<psalm
33
autoloader="./.psalm/autoloader.php"
44
totallyTyped="true"
5-
useDocblockTypes="true"
65
useDocblockPropertyTypes="true"
76
usePhpDocMethodsWithoutMagicCall="true"
87
strictBinaryOperands="true"
9-
requireVoidReturnType="true"
10-
useAssertForType="true"
11-
rememberPropertyAssignmentsAfterCall="true"
12-
allowPhpStormGenerics="true"
13-
allowStringToStandInForClass="false"
14-
memoizeMethodCallResults="false"
15-
hoistConstants="false"
16-
addParamDefaultToDocblockType="false"
17-
checkForThrowsInGlobalScope="false"
188
ignoreInternalFunctionFalseReturn="false"
199
ignoreInternalFunctionNullReturn="false"
2010
hideExternalErrors="true"
21-
allowFileIncludes="true"
2211
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2312
xmlns="https://getpsalm.org/schema/config"
2413
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"

0 commit comments

Comments
 (0)