Skip to content

Commit

Permalink
Improve CI support for PHP 8+
Browse files Browse the repository at this point in the history
  • Loading branch information
flavioheleno committed Jul 22, 2021
1 parent 17e7e92 commit 53f13fe
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ on:
- 'doc/**'

jobs:
tests:
name: PHP ${{ matrix.php-version }}
phpunit:
name: PHP ${{ matrix.php-version }} (${{ matrix.dependency-version }})

runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
Expand All @@ -21,9 +21,14 @@ jobs:
php-version:
- "7.4"
- "8.0"
dependency-version: [prefer-lowest, prefer-stable]
experimental: [false]
include:
- php-version: "8.1"
dependency-version: "prefer-lowest"
experimental: true
- php-version: "8.1"
dependency-version: "prefer-lowest"
experimental: true

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

- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer install --prefer-dist --no-progress --optimize-autoloader --no-interaction
- name: Install dependencies (PHP 7)
if: steps.composer-cache.outputs.cache-hit != 'true' && matrix.php-version < 8
run: composer update --${{ matrix.dependency-version }} --no-progress --no-interaction

- name: Install dependencies (PHP 8)
if: steps.composer-cache.outputs.cache-hit != 'true' && matrix.php-version >= 8
run: composer update --${{ matrix.dependency-version }} --ignore-platform-req=php --no-progress --no-interaction

- name: Run PHPUnit test suite
run: composer run-script test-ci
Expand Down

0 comments on commit 53f13fe

Please sign in to comment.