Skip to content

Commit 53f13fe

Browse files
committed
Improve CI support for PHP 8+
1 parent 17e7e92 commit 53f13fe

1 file changed

Lines changed: 14 additions & 5 deletions

File tree

.github/workflows/continuous-integration.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ on:
99
- 'doc/**'
1010

1111
jobs:
12-
tests:
13-
name: PHP ${{ matrix.php-version }}
12+
phpunit:
13+
name: PHP ${{ matrix.php-version }} (${{ matrix.dependency-version }})
1414

1515
runs-on: ubuntu-latest
1616
continue-on-error: ${{ matrix.experimental }}
@@ -21,9 +21,14 @@ jobs:
2121
php-version:
2222
- "7.4"
2323
- "8.0"
24+
dependency-version: [prefer-lowest, prefer-stable]
2425
experimental: [false]
2526
include:
2627
- php-version: "8.1"
28+
dependency-version: "prefer-lowest"
29+
experimental: true
30+
- php-version: "8.1"
31+
dependency-version: "prefer-lowest"
2732
experimental: true
2833

2934
steps:
@@ -50,9 +55,13 @@ jobs:
5055
key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }}
5156
restore-keys: ${{ runner.os }}-php-${{ matrix.php-version }}-
5257

53-
- name: Install dependencies
54-
if: steps.composer-cache.outputs.cache-hit != 'true'
55-
run: composer install --prefer-dist --no-progress --optimize-autoloader --no-interaction
58+
- name: Install dependencies (PHP 7)
59+
if: steps.composer-cache.outputs.cache-hit != 'true' && matrix.php-version < 8
60+
run: composer update --${{ matrix.dependency-version }} --no-progress --no-interaction
61+
62+
- name: Install dependencies (PHP 8)
63+
if: steps.composer-cache.outputs.cache-hit != 'true' && matrix.php-version >= 8
64+
run: composer update --${{ matrix.dependency-version }} --ignore-platform-req=php --no-progress --no-interaction
5665

5766
- name: Run PHPUnit test suite
5867
run: composer run-script test-ci

0 commit comments

Comments
 (0)