From 849f890990716b115b6327a88e1d53d8128e1411 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Sun, 25 Feb 2024 22:12:46 +0100 Subject: [PATCH] GH Actions: update the workflows to allow for PHPUnit 11 --- .github/workflows/quicktest.yml | 5 ++++- .github/workflows/test.yml | 13 ++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/quicktest.yml b/.github/workflows/quicktest.yml index c32176cf..ddd88be3 100644 --- a/.github/workflows/quicktest.yml +++ b/.github/workflows/quicktest.yml @@ -92,7 +92,10 @@ jobs: - name: Determine PHPUnit config file to use id: phpunit_config run: | - if [ "${{ startsWith( steps.phpunit_version.outputs.VERSION, '10.' ) }}" == "true" ]; then + if [ "${{ startsWith( steps.phpunit_version.outputs.VERSION, '11.' ) }}" == "true" ]; then + echo 'FILE=phpunit10.xml.dist' >> $GITHUB_OUTPUT + echo 'EXTRA_ARGS=' >> $GITHUB_OUTPUT + elif [ "${{ startsWith( steps.phpunit_version.outputs.VERSION, '10.' ) }}" == "true" ]; then echo 'FILE=phpunit10.xml.dist' >> $GITHUB_OUTPUT echo 'EXTRA_ARGS=' >> $GITHUB_OUTPUT else diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 324897f1..4136d422 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -213,7 +213,10 @@ jobs: - name: Determine PHPUnit config file to use id: phpunit_config run: | - if [ "${{ startsWith( steps.phpunit_version.outputs.VERSION, '10.' ) }}" == "true" ]; then + if [ "${{ startsWith( steps.phpunit_version.outputs.VERSION, '11.' ) }}" == "true" ]; then + echo 'FILE=phpunit10.xml.dist' >> $GITHUB_OUTPUT + echo 'EXTRA_ARGS=' >> $GITHUB_OUTPUT + elif [ "${{ startsWith( steps.phpunit_version.outputs.VERSION, '10.' ) }}" == "true" ]; then echo 'FILE=phpunit10.xml.dist' >> $GITHUB_OUTPUT echo 'EXTRA_ARGS=' >> $GITHUB_OUTPUT else @@ -338,20 +341,20 @@ jobs: # As of PHPUnit 9.3.4, a cache warming option is available. # Using that option prevents issues with PHP-Parser backfilling PHP tokens when PHPCS does not (yet), # which would otherwise cause tests to fail on tokens being available when they shouldn't be. - # As coverage is only run on high/low PHP, the high PHP version will use PHPUnit 10, so just check for that. + # As coverage is only run on high/low PHP, the high PHP version will use PHPUnit 11, so just check for that. - name: "Warm the PHPUnit cache (PHPUnit 9.3+)" - if: ${{ startsWith( steps.phpunit_version.outputs.VERSION, '10.' ) }} + if: ${{ startsWith( steps.phpunit_version.outputs.VERSION, '11.' ) }} run: vendor/bin/phpunit -c phpunit10.xml.dist --coverage-cache ./build/phpunit-cache --warm-coverage-cache - name: "Run the unit tests without caching with code coverage (PHPUnit < 10)" - if: ${{ ! startsWith( steps.phpunit_version.outputs.VERSION, '10.' ) }} + if: ${{ ! startsWith( steps.phpunit_version.outputs.VERSION, '11.' ) }} run: vendor/bin/phpunit env: PHPCS_VERSION: ${{ matrix.phpcs_version }} PHPCSUTILS_USE_CACHE: false - name: "Run the unit tests without caching with code coverage (PHPUnit 10+)" - if: ${{ startsWith( steps.phpunit_version.outputs.VERSION, '10.' ) }} + if: ${{ startsWith( steps.phpunit_version.outputs.VERSION, '11.' ) }} run: vendor/bin/phpunit -c phpunit10.xml.dist --coverage-cache ./build/phpunit-cache env: PHPCS_VERSION: ${{ matrix.phpcs_version }}