6363 strategy :
6464 fail-fast : false
6565 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' ]
6767 os : [ ubuntu-latest ]
6868 memcached : [ false ]
6969 split_slow : [ false ]
9595 memcached : false
9696 multisite : false
9797 report : true
98+
9899 env :
99100 LOCAL_PHP : ${{ matrix.php }}-fpm
100101 LOCAL_PHP_MEMCACHED : ${{ matrix.memcached }}
@@ -142,7 +143,7 @@ jobs:
142143 docker-compose run --rm php composer --version
143144
144145 # 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
146147 docker-compose run --rm php composer update --ignore-platform-reqs
147148 else
148149 docker-compose run --rm php composer update
@@ -187,7 +188,7 @@ jobs:
187188 run : npm run env:install
188189
189190 - name : Run slow PHPUnit tests
190- if : ${{ matrix.split_slow }}
191+ if : ${{ matrix.php != '8.1' && matrix. split_slow }}
191192 run : npm run test:php-composer -- --verbose -c ${{ env.PHPUNIT_CONFIG }} --group ${{ env.SLOW_TESTS }}
192193
193194 - name : Run PHPUnit tests for single site excluding slow tests
@@ -199,25 +200,63 @@ jobs:
199200 run : npm run test:php-composer -- --verbose -c ${{ env.PHPUNIT_CONFIG }} --exclude-group ${{ env.SLOW_TESTS }},ajax,ms-files,ms-excluded,oembed-headers
200201
201202 - 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
203237 run : npm run test:php-composer -- --verbose -c ${{ env.PHPUNIT_CONFIG }}
204238
205239 - name : Run AJAX tests
206- if : ${{ ! matrix.split_slow }}
240+ if : ${{ matrix.php == '8.1' && ! matrix.split_slow }}
241+ continue-on-error : true
207242 run : npm run test:php-composer -- --verbose -c ${{ env.PHPUNIT_CONFIG }} --group ajax
208243
209244 - 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
211247 run : npm run test:php-composer -- --verbose -c tests/phpunit/multisite.xml --group ms-files
212248
213249 - 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
215252 run : npm run test:php-composer -- --verbose -c phpunit.xml.dist --group external-http
216253
217254 # __fakegroup__ is excluded to force PHPUnit to ignore the <exclude> settings in phpunit.xml.dist.
218255 - name : Run (xDebug) tests
219- if : ${{ ! matrix.split_slow }}
256+ if : ${{ matrix.php == '8.1' && ! matrix.split_slow }}
257+ continue-on-error : true
220258 run : LOCAL_PHP_XDEBUG=true npm run test:php-composer -- -v --group xdebug --exclude-group __fakegroup__
259+ # ### End of duplicate set of test runs. ####
221260
222261 - name : Ensure version-controlled files are not modified or deleted
223262 run : git diff --exit-code
0 commit comments