1
1
name : PHP Quality Assurance
2
- on : [push]
2
+ on :
3
+ push :
4
+ # Allow manually triggering the workflow.
5
+ workflow_dispatch :
6
+
7
+ # Cancels all previous workflow runs for the same branch that have not yet completed.
8
+ concurrency :
9
+ # The concurrency group contains the workflow name and the branch name.
10
+ group : ${{ github.workflow }}-${{ github.ref }}
11
+ cancel-in-progress : true
12
+
3
13
jobs :
4
14
qa :
5
15
runs-on : ubuntu-latest
6
16
if : " !contains(github.event.head_commit.message, 'ci skip')"
7
17
strategy :
8
18
fail-fast : true
9
19
matrix :
10
- php-versions : ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2']
20
+ php-versions : ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1']
21
+ dependency-versions : ['lowest', 'highest']
22
+
23
+ include :
24
+ - php-versions : ' 8.2'
25
+ dependency-versions : ' highest'
11
26
12
27
continue-on-error : ${{ matrix.php-versions == '8.2' }}
13
28
@@ -18,32 +33,45 @@ jobs:
18
33
uses : shivammathur/setup-php@v2
19
34
with :
20
35
php-version : ${{ matrix.php-versions }}
21
- ini-values : error_reporting=-1, display_errors=On
36
+ ini-values : zend.assertions=1, error_reporting=-1, display_errors=On
37
+ coverage : ${{ ( matrix.php-versions == '7.4' && 'xdebug' ) || 'none' }}
38
+ tools : parallel-lint
22
39
23
40
- name : Check syntax error in sources
24
- run : find ./src/ ./tests/ -type f -name '*.php' -print0 | xargs -0 -L 1 -P 4 -- php -l
41
+ if : ${{ matrix.dependency-versions == 'highest' }}
42
+ run : parallel-lint ./src/ ./tests/
25
43
26
44
- name : Install dependencies - normal
27
45
if : ${{ matrix.php-versions != '8.2' }}
28
- run : composer install -q -n -a --no-progress --prefer-dist
46
+ uses : " ramsey/composer-install@v1"
47
+ with :
48
+ dependency-versions : ${{ matrix.dependency-versions }}
29
49
30
50
- name : Install dependencies - ignore-platform-reqs
31
51
if : ${{ matrix.php-versions == '8.2' }}
32
- run : composer install -q -n -a --no-progress --prefer-dist --ignore-platform-reqs
52
+ uses : " ramsey/composer-install@v1"
53
+ with :
54
+ dependency-versions : ${{ matrix.dependency-versions }}
55
+ composer-options : " --ignore-platform-reqs"
33
56
34
57
- name : Check cross-version PHP compatibility
35
- if : ${{ matrix.php-versions == '7.4' }} # results is same across versions, do it once
58
+ if : ${{ matrix.php-versions == '7.4' && matrix.dependency-versions == 'highest' }} # results is same across versions, do it once
36
59
run : composer phpcompat
37
60
38
61
- name : Migrate test configuration (>= 7.3)
39
- if : ${{ matrix.php-versions >= 7.3 }}
62
+ if : ${{ matrix.php-versions >= 7.3 && matrix.dependency-versions == 'highest' }}
40
63
run : ./vendor/bin/phpunit --migrate-configuration
41
64
42
- - name : Run unit tests
65
+ - name : Run unit tests (without code coverage)
66
+ if : ${{ matrix.php-versions != '7.4' || matrix.dependency-versions != 'highest' }}
67
+ run : ./vendor/bin/phpunit
68
+
69
+ - name : Run unit tests with code coverage
70
+ if : ${{ matrix.php-versions == '7.4' && matrix.dependency-versions == 'highest' }}
43
71
run : ./vendor/bin/phpunit --coverage-clover=coverage.xml
44
72
45
73
- name : Update codecov.io
46
74
uses : codecov/codecov-action@v1
47
- if : ${{ matrix.php-versions == '7.4' }} # upload coverage once is enough
75
+ if : ${{ matrix.php-versions == '7.4' && matrix.dependency-versions == 'highest' }} # upload coverage once is enough
48
76
with :
49
77
file : ./coverage.xml
0 commit comments