63
63
strategy :
64
64
fail-fast : false
65
65
matrix :
66
- php : [ '5.6.20', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0' ]
66
+ php : [ '5.6.20', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1' ]
67
67
os : [ ubuntu-latest ]
68
68
memcached : [ false ]
69
69
split_slow : [ false ]
95
95
memcached : false
96
96
multisite : false
97
97
report : true
98
+
98
99
env :
99
100
LOCAL_PHP : ${{ matrix.php }}-fpm
100
101
LOCAL_PHP_MEMCACHED : ${{ matrix.memcached }}
@@ -142,7 +143,7 @@ jobs:
142
143
docker-compose run --rm php composer --version
143
144
144
145
# Install using `composer update` as there is no `composer.lock` file.
145
- if [ ${{ env.LOCAL_PHP }} == '8.0 -fpm' ]; then
146
+ if [ ${{ env.LOCAL_PHP }} == '8.1 -fpm' ]; then
146
147
docker-compose run --rm php composer update --ignore-platform-reqs
147
148
else
148
149
docker-compose run --rm php composer update
@@ -187,7 +188,7 @@ jobs:
187
188
run : npm run env:install
188
189
189
190
- name : Run slow PHPUnit tests
190
- if : ${{ matrix.split_slow }}
191
+ if : ${{ matrix.php != '8.1' && matrix. split_slow }}
191
192
run : npm run test:php-composer -- --verbose -c ${{ env.PHPUNIT_CONFIG }} --group ${{ env.SLOW_TESTS }}
192
193
193
194
- name : Run PHPUnit tests for single site excluding slow tests
@@ -199,25 +200,63 @@ jobs:
199
200
run : npm run test:php-composer -- --verbose -c ${{ env.PHPUNIT_CONFIG }} --exclude-group ${{ env.SLOW_TESTS }},ajax,ms-files,ms-excluded,oembed-headers
200
201
201
202
- name : Run PHPUnit tests
202
- if : ${{ matrix.php >= '7.0' }}
203
+ if : ${{ matrix.php >= '7.0' && matrix.php != '8.1' }}
204
+ run : npm run test:php-composer -- --verbose -c ${{ env.PHPUNIT_CONFIG }}
205
+
206
+ - name : Run AJAX tests
207
+ if : ${{ matrix.php != '8.1' && ! matrix.split_slow }}
208
+ run : npm run test:php-composer -- --verbose -c ${{ env.PHPUNIT_CONFIG }} --group ajax
209
+
210
+ - name : Run ms-files tests as a multisite install
211
+ if : ${{ matrix.php != '8.1' && matrix.multisite && ! matrix.split_slow }}
212
+ run : npm run test:php-composer -- --verbose -c tests/phpunit/multisite.xml --group ms-files
213
+
214
+ - name : Run external HTTP tests
215
+ if : ${{ matrix.php != '8.1' && ! matrix.multisite && ! matrix.split_slow }}
216
+ run : npm run test:php-composer -- --verbose -c phpunit.xml.dist --group external-http
217
+
218
+ # __fakegroup__ is excluded to force PHPUnit to ignore the <exclude> settings in phpunit.xml.dist.
219
+ - name : Run (xDebug) tests
220
+ if : ${{ matrix.php != '8.1' && ! matrix.split_slow }}
221
+ run : LOCAL_PHP_XDEBUG=true npm run test:php-composer -- -v --group xdebug --exclude-group __fakegroup__
222
+
223
+ # ### Duplicate set of test runs specifically for PHP 8.1 while WP is not yet compatible. ####
224
+ # Splitting off the test runs for PHP 8.1 allows us to apply "continue-on-error" to the job steps,
225
+ # which will prevent the builds from showing as "failed" when they only fail on PHP 8.1.
226
+ # This block should be removed once all PHP 8.1 test failures have been fixed.
227
+ # When the block is removed, the conditions in the block above should also be adjusted back
228
+ # to their original values.
229
+ - name : Run slow PHPUnit tests
230
+ if : ${{ matrix.php == '8.1' && matrix.split_slow }}
231
+ continue-on-error : true
232
+ run : npm run test:php-composer -- --verbose -c ${{ env.PHPUNIT_CONFIG }} --group ${{ env.SLOW_TESTS }}
233
+
234
+ - name : Run PHPUnit tests
235
+ if : ${{ matrix.php == '8.1' }}
236
+ continue-on-error : true
203
237
run : npm run test:php-composer -- --verbose -c ${{ env.PHPUNIT_CONFIG }}
204
238
205
239
- name : Run AJAX tests
206
- if : ${{ ! matrix.split_slow }}
240
+ if : ${{ matrix.php == '8.1' && ! matrix.split_slow }}
241
+ continue-on-error : true
207
242
run : npm run test:php-composer -- --verbose -c ${{ env.PHPUNIT_CONFIG }} --group ajax
208
243
209
244
- name : Run ms-files tests as a multisite install
210
- if : ${{ matrix.multisite && ! matrix.split_slow }}
245
+ if : ${{ matrix.php == '8.1' && matrix.multisite && ! matrix.split_slow }}
246
+ continue-on-error : true
211
247
run : npm run test:php-composer -- --verbose -c tests/phpunit/multisite.xml --group ms-files
212
248
213
249
- name : Run external HTTP tests
214
- if : ${{ ! matrix.multisite && ! matrix.split_slow }}
250
+ if : ${{ matrix.php == '8.1' && ! matrix.multisite && ! matrix.split_slow }}
251
+ continue-on-error : true
215
252
run : npm run test:php-composer -- --verbose -c phpunit.xml.dist --group external-http
216
253
217
254
# __fakegroup__ is excluded to force PHPUnit to ignore the <exclude> settings in phpunit.xml.dist.
218
255
- name : Run (xDebug) tests
219
- if : ${{ ! matrix.split_slow }}
256
+ if : ${{ matrix.php == '8.1' && ! matrix.split_slow }}
257
+ continue-on-error : true
220
258
run : LOCAL_PHP_XDEBUG=true npm run test:php-composer -- -v --group xdebug --exclude-group __fakegroup__
259
+ # ### End of duplicate set of test runs. ####
221
260
222
261
- name : Ensure version-controlled files are not modified or deleted
223
262
run : git diff --exit-code
0 commit comments