@@ -19,6 +19,41 @@ concurrency:
1919 cancel-in-progress : true
2020
2121jobs :
22+ lint :
23+ if : ${{ github.ref != 'refs/heads/develop' }}
24+ runs-on : ubuntu-latest
25+
26+ strategy :
27+ matrix :
28+ php : ['5.4', '7.0', '7.4', '8.0', '8.4', '8.5']
29+
30+ name : " Lint: PHP ${{ matrix.php }}"
31+
32+ continue-on-error : ${{ matrix.php == '8.5' }}
33+
34+ steps :
35+ - name : Checkout code
36+ uses : actions/checkout@v4
37+
38+ - name : Install PHP
39+ uses : shivammathur/setup-php@v2
40+ with :
41+ php-version : ${{ matrix.php }}
42+ ini-file : ' development'
43+ coverage : none
44+ tools : cs2pr
45+
46+ - name : Install Composer dependencies
47+ uses : " ramsey/composer-install@v3"
48+ with :
49+ # For the PHP "nightly", we need to install with ignore platform reqs as not all dependencies may allow it yet.
50+ composer-options : ${{ matrix.php == '8.5' && '--ignore-platform-req=php+' || '' }}
51+ # Bust the cache at least once a month - output format: YYYY-MM.
52+ custom-cache-suffix : $(date -u "+%Y-%m")
53+
54+ - name : " Lint against parse errors"
55+ run : composer lint -- --checkstyle | cs2pr
56+
2257 # ### TEST STAGE ####
2358 test :
2459 if : ${{ github.ref != 'refs/heads/develop' }}
3570 php : ['5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.5']
3671 phpcs_version : ['lowest', 'dev-master']
3772
38- name : " Test${{ matrix.phpcs_version == 'dev-master' && ' + Lint' || '' }} : PHP ${{ matrix.php }} - PHPCS ${{ matrix.phpcs_version }}"
73+ name : " Test: PHP ${{ matrix.php }} - PHPCS ${{ matrix.phpcs_version }}"
3974
4075 continue-on-error : ${{ matrix.php == '8.5' }}
4176
74109 - name : Install Composer dependencies
75110 uses : " ramsey/composer-install@v3"
76111 with :
112+ # For the PHP "nightly", we need to install with ignore platform reqs as not all dependencies may allow it yet.
113+ composer-options : ${{ matrix.php == '8.5' && '--ignore-platform-req=php+' || '' }}
77114 # Bust the cache at least once a month - output format: YYYY-MM.
78115 custom-cache-suffix : $(date -u "+%Y-%m")
79116
@@ -84,10 +121,6 @@ jobs:
84121 squizlabs/php_codesniffer
85122 phpcsstandards/phpcsutils
86123
87- - name : Lint against parse errors
88- if : matrix.phpcs_version == 'dev-master'
89- run : composer lint
90-
91124 - name : Run the unit tests
92125 run : composer test
93126
@@ -108,7 +141,7 @@ jobs:
108141 php : ['5.4', '8.4']
109142 phpcs_version : ['lowest', 'dev-master']
110143
111- name : " Coverage${{ matrix.phpcs_version == 'dev-master' && ' + Lint' || '' }} : PHP ${{ matrix.php }} - PHPCS ${{ matrix.phpcs_version }}"
144+ name : " Coverage: PHP ${{ matrix.php }} - PHPCS ${{ matrix.phpcs_version }}"
112145
113146 steps :
114147 - name : Checkout code
@@ -131,7 +164,6 @@ jobs:
131164 php-version : ${{ matrix.php }}
132165 ini-values : ${{ steps.set_ini.outputs.PHP_INI }}
133166 coverage : xdebug
134- tools : cs2pr
135167
136168 - name : " Composer: set PHPCS version for tests (master)"
137169 if : ${{ matrix.phpcs_version != 'lowest' }}
@@ -156,10 +188,6 @@ jobs:
156188 squizlabs/php_codesniffer
157189 phpcsstandards/phpcsutils
158190
159- - name : Lint against parse errors
160- if : matrix.phpcs_version == 'dev-master'
161- run : composer lint -- --checkstyle | cs2pr
162-
163191 - name : Run the unit tests with code coverage
164192 run : composer coverage
165193
0 commit comments