Skip to content

Commit 0478c56

Browse files
committed
GH Actions: adjust the test workflow
... to: * Run the availability tests against all PHP versions on which the package can be installed with `prefer-stable`. * Run the availability tests as well as the _real_ tests against `lowest` and `stable` for PHPUnit 9 on PHP 7.3 - 8.0. The test selection is done automatically via the `phpunit.xml.dist` file as adjusted in the previous commit. As for the running of the _real_ tests against the `lowest` supported PHPUnit 9 version, this requires some tweaking to the workflow script. As PHPUnit didn't always have an explicit requirement for PHP, running with `prefer-lowest` on PHP 7.3 - 8.0 with the current PHPUnit version constraints would install PHPUnit 4.8. So, for the `prefer-lowest` runs, we need to make sure that `lowest` is correctly interpreted as "lowest" within the PHPUnit 9.x range. Also: * As the coding standards package has a minimum PHP requirement of PHP 7.2, it would block the `composer install` for lower PHP versions to run the tests, so removing the package for this workflow.
1 parent 1d10fa5 commit 0478c56

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

.github/workflows/run-tests.yml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,21 @@ jobs:
2121

2222
strategy:
2323
matrix:
24-
php: ['8.0', '7.4', '7.3']
25-
dependency-version: [prefer-lowest, prefer-stable]
24+
php: ['8.0', '7.4', '7.3', '7.2', '7.1', '7.0', '5.6', '5.5', '5.4']
25+
dependency-version: ['prefer-stable']
2626
experimental: [false]
2727

2828
include:
29+
- php: '7.3'
30+
dependency-version: 'prefer-lowest'
31+
experimental: false
32+
- php: '7.4'
33+
dependency-version: 'prefer-lowest'
34+
experimental: false
35+
- php: '8.0'
36+
dependency-version: 'prefer-lowest'
37+
experimental: false
38+
2939
- php: '8.1'
3040
dependency-version: 'prefer-stable'
3141
experimental: true
@@ -44,6 +54,15 @@ jobs:
4454
coverage: none
4555
tools: composer
4656

57+
# Remove the coding standards package as it has a higher minimum PHP
58+
# requirement and would prevent running the tests on older PHP versions.
59+
- name: 'Composer: remove CS dependency'
60+
run: composer remove --dev --no-update dms/coding-standard
61+
62+
- name: 'Composer: update PHPUnit for testing lowest'
63+
if: ${{ matrix.dependency-version == 'prefer-lowest' }}
64+
run: composer require --no-update phpunit/phpunit:"^9.0"
65+
4766
- name: Install dependencies - normal
4867
if: ${{ matrix.php < 8.1 }}
4968
run: |

0 commit comments

Comments
 (0)