Skip to content

Commit 5cbdeb0

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` (`highest`). * Run the availability tests, as well as the _real_ tests against `lowest` and `stable` for PHPUnit 9.1+ on PHP 7.3 - 8.1. 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.1 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.1+ range.
1 parent 2c7179a commit 5cbdeb0

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

.github/workflows/ci.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,20 @@ jobs:
3434
strategy:
3535
fail-fast: false
3636
matrix:
37-
php: ['7.3', '7.4', '8.0', '8.1']
37+
php: ['5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1']
38+
dependency-versions: ['highest']
3839

39-
name: PHP ${{ matrix.php }}
40+
include:
41+
- php: '7.3'
42+
dependency-versions: 'lowest'
43+
- php: '7.4'
44+
dependency-versions: 'lowest'
45+
- php: '8.0'
46+
dependency-versions: 'lowest'
47+
- php: '8.1'
48+
dependency-versions: 'lowest'
49+
50+
name: PHP ${{ matrix.php }} - ${{ matrix.dependency-versions }}
4051

4152
steps:
4253
- name: Checkout code
@@ -49,10 +60,16 @@ jobs:
4960
ini-values: zend.assertions=1, error_reporting=-1, display_errors=On
5061
coverage: xdebug
5162

63+
- name: 'Composer: update PHPUnit for testing lowest'
64+
if: ${{ matrix.dependency-versions == 'lowest' }}
65+
run: composer require --no-update phpunit/phpunit:"^9.1"
66+
5267
# Install dependencies and handle caching in one go.
5368
# @link https://github.com/marketplace/actions/install-composer-dependencies
5469
- name: Install Composer dependencies
5570
uses: "ramsey/composer-install@v1"
71+
with:
72+
dependency-versions: ${{ matrix.dependency-versions }}
5673

5774
- name: Execute Unit Tests
5875
run: vendor/bin/phpunit --coverage-text

0 commit comments

Comments
 (0)