Skip to content

Commit cc678d1

Browse files
committed
GH Actions: improve fix to run the tests on PHP 8.1
There is no need to remove the config file and have all settings on the command-line as PHPUnit offers a `--no-configuration` option to ignore the config file. Enabling that simplifies the action steps a little and isolates the customization for PHP 8.1 to PHP 8.1.
1 parent 6dc06c0 commit cc678d1

File tree

1 file changed

+9
-14
lines changed

1 file changed

+9
-14
lines changed

.github/workflows/test.yml

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -85,21 +85,16 @@ jobs:
8585
- name: 'PHPCS: set the path to PHP'
8686
run: php bin/phpcs --config-set php_path php
8787

88-
# We need to remove the config file so that PHPUnit doesn't try to read it.
89-
# This causes an error on PHP 8.1+ with PHPunit 7, but it's not needed here anyway as the
90-
# phpunit command (below) specifies all required settings.
91-
- name: 'PHPUnit: remove config file'
92-
run: rm phpunit.xml.dist
93-
94-
# Useless tests were not reported for before PHPUnit 6, so it doesn't
95-
# understand the CLI argument.
9688
- name: 'PHPUnit: run the tests'
97-
if: ${{ matrix.php < 7.0 }}
98-
run: vendor/bin/phpunit tests/AllTests.php --bootstrap=tests/bootstrap.php
99-
100-
- name: 'PHPUnit: run the tests, dont report useless'
101-
if: ${{ matrix.php >= 7.0 }}
102-
run: vendor/bin/phpunit tests/AllTests.php --bootstrap=tests/bootstrap.php --dont-report-useless-tests
89+
if: ${{ matrix.php != 8.1 }}
90+
run: vendor/bin/phpunit tests/AllTests.php
91+
92+
# We need to ignore the config file so that PHPUnit doesn't try to read it.
93+
# The config file causes an error on PHP 8.1+ with PHPunit 7, but it's not needed here anyway
94+
# as we can pass all required settings in the phpunit command.
95+
- name: 'PHPUnit: run the tests on PHP nightly'
96+
if: ${{ matrix.php == 8.1 }}
97+
run: vendor/bin/phpunit tests/AllTests.php --no-configuration --bootstrap=tests/bootstrap.php --dont-report-useless-tests
10398

10499
- name: 'PHPCS: check code style without cache, no parallel'
105100
if: ${{ matrix.custom_ini == false }}

0 commit comments

Comments
 (0)