File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -240,6 +240,26 @@ jobs:
240240 # Bust the cache at least once a month - output format: YYYY-MM.
241241 custom-cache-suffix : $(date -u "+%Y-%m")
242242
243+ - name : Grab PHPUnit version
244+ id : phpunit_version
245+ run : echo "VERSION=$(vendor/bin/phpunit --version | grep --only-matching --max-count=1 --extended-regexp '\b[0-9]+\.[0-9]+')" >> $GITHUB_OUTPUT
246+
247+ - name : Determine PHPUnit flavour
248+ id : phpunit_version
249+ run : |
250+ if [ startsWith( steps.phpunit_version.outputs.VERSION, '10.' ) }}" == "true" ]; then
251+ echo 'FLAVOUR=gte10' >> $GITHUB_OUTPUT
252+ else
253+ echo 'FLAVOUR=lte9' >> $GITHUB_OUTPUT
254+ fi
255+
256+ # PHPUnit 10 may fail a test run when the "old" configuration format is used.
257+ # Luckily, there is a build-in migration tool since PHPUnit 9.3.
258+ - name : Migrate PHPUnit configuration for PHPUnit 10+
259+ if : ${{ steps.phpunit_version.outputs.FLAVOUR == 'gte10' }}
260+ continue-on-error : true
261+ run : composer phpunit -- --migrate-configuration
262+
243263 - name : Setup problem matcher to provide annotations for PHPUnit
244264 run : echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
245265
You can’t perform that action at this time.
0 commit comments