Skip to content

Commit ccef631

Browse files
committed
GH Actions/tests: safeguard that tests pass in CBF mode
Some tests had sneaked in which would pass in CS mode, but not in CBF mode - at least, not without some tweaks. This adds a test run of the complete test suite in CBF mode against one PHP version to ensure this can't happen again.
1 parent a860c74 commit ccef631

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

.github/workflows/test.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,21 +222,28 @@ jobs:
222222
composer-options: ${{ matrix.php == '8.5' && '--ignore-platform-req=php+' || '' }}
223223
custom-cache-suffix: $(date -u "+%Y-%m")
224224

225-
# Note: The code style check is run multiple times against every PHP version
226-
# as it also acts as an integration test.
227225
- name: 'PHPCS: set the path to PHP'
228226
run: php "bin/phpcs" --config-set php_path php
229227

230228
- name: 'PHPUnit: run the full test suite without code coverage'
231229
if: ${{ matrix.skip_tests != true }}
232230
run: php "vendor/bin/phpunit" tests/AllTests.php --no-coverage
233231

232+
# Do one test run against the complete test suite in CBF mode to ensure all tests can run in CBF mode.
233+
- name: 'PHPUnit: run the full test suite without code coverage in CBF mode (PHP 8.3 only)'
234+
if: ${{ matrix.php == '8.3' }}
235+
run: php "vendor/bin/phpunit" tests/AllTests.php --exclude-group nothing --no-coverage
236+
env:
237+
PHP_CODESNIFFER_CBF: '1'
238+
234239
- name: 'PHPUnit: run select tests in CBF mode'
235-
if: ${{ matrix.skip_tests != true }}
240+
if: ${{ matrix.skip_tests != true && matrix.php != '8.3' }}
236241
run: php "vendor/bin/phpunit" tests/AllTests.php --group CBF --exclude-group nothing --no-coverage
237242
env:
238243
PHP_CODESNIFFER_CBF: '1'
239244

245+
# Note: The code style check is run multiple times against every PHP version
246+
# as it also acts as an integration test.
240247
- name: 'PHPCS: check code style without cache, no parallel'
241248
if: ${{ matrix.custom_ini == false }}
242249
run: php "bin/phpcs" --no-cache --parallel=1

0 commit comments

Comments
 (0)