@@ -19,6 +19,41 @@ concurrency:
19
19
cancel-in-progress : true
20
20
21
21
jobs :
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
+
22
57
# ### TEST STAGE ####
23
58
test :
24
59
if : ${{ github.ref != 'refs/heads/develop' }}
35
70
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']
36
71
phpcs_version : ['lowest', 'dev-master']
37
72
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 }}"
39
74
40
75
continue-on-error : ${{ matrix.php == '8.5' }}
41
76
74
109
- name : Install Composer dependencies
75
110
uses : " ramsey/composer-install@v3"
76
111
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+' || '' }}
77
114
# Bust the cache at least once a month - output format: YYYY-MM.
78
115
custom-cache-suffix : $(date -u "+%Y-%m")
79
116
@@ -84,10 +121,6 @@ jobs:
84
121
squizlabs/php_codesniffer
85
122
phpcsstandards/phpcsutils
86
123
87
- - name : Lint against parse errors
88
- if : matrix.phpcs_version == 'dev-master'
89
- run : composer lint
90
-
91
124
- name : Run the unit tests
92
125
run : composer test
93
126
@@ -108,7 +141,7 @@ jobs:
108
141
php : ['5.4', '8.4']
109
142
phpcs_version : ['lowest', 'dev-master']
110
143
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 }}"
112
145
113
146
steps :
114
147
- name : Checkout code
@@ -131,7 +164,6 @@ jobs:
131
164
php-version : ${{ matrix.php }}
132
165
ini-values : ${{ steps.set_ini.outputs.PHP_INI }}
133
166
coverage : xdebug
134
- tools : cs2pr
135
167
136
168
- name : " Composer: set PHPCS version for tests (master)"
137
169
if : ${{ matrix.phpcs_version != 'lowest' }}
@@ -156,10 +188,6 @@ jobs:
156
188
squizlabs/php_codesniffer
157
189
phpcsstandards/phpcsutils
158
190
159
- - name : Lint against parse errors
160
- if : matrix.phpcs_version == 'dev-master'
161
- run : composer lint -- --checkstyle | cs2pr
162
-
163
191
- name : Run the unit tests with code coverage
164
192
run : composer coverage
165
193
0 commit comments