Skip to content

Commit

Permalink
GH Actions/CI: run the test suite against PHP 8.1, 8.2 and 8.3 (#363)
Browse files Browse the repository at this point in the history
* Fix PHP 8.1 compatibility

The tests were failing on PHP 8.1 due to a `file_exists(): Passing null to parameter #1 ($filename) of type string is deprecated` notice coming from the `JobsRepository::dumpJsonFile()` method.

While it would probably be unlikely for this error condition ever to be hit in a real life situation, it is something which is likely to happen in the tests and well, a little defensive coding goes a long way.

With this fix in place, the tests now pass on PHP 8.1 and PHP 8.2 and compatibility with both can be declared. 🎉

* GH Actions/CI: run the test suite against PHP 8.1, 8.2 and 8.3

PR 361 should fix the remaining (known) PHP 8.1 error.

Once that PR has been merged, the CI runs against PHP 8.1, 8.2 and 8.3 should pass.

To that end, I'm adding builds against PHP 8.1, 8.2 and 8.3.

I'm also moving the code coverage recording from PHP 7.4 to PHP 8.2 to ensure high/low PHP is measured and adding an extra variant with `Xdebug` on high PHP too.

As PHP 8.3 is still in flux, builds against it are still allowed to fail.

---------

Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
  • Loading branch information
jrfnl and jrfnl committed Jul 15, 2023
1 parent e2556b3 commit f08f945
Showing 1 changed file with 24 additions and 5 deletions.
29 changes: 24 additions & 5 deletions .github/workflows/ci.yml
Expand Up @@ -36,13 +36,29 @@ jobs:
os: ubuntu-latest
- php: '7.4'
os: ubuntu-latest
- php: '7.4'
os: windows-latest
coverage: 'pcov'
- php: '8.0'
os: ubuntu-latest
symfony: '^6.0'
- php: '8.1'
os: ubuntu-latest
symfony: '^6.0'
- php: '8.2'
os: ubuntu-latest
symfony: '^6.0'
coverage: 'pcov'
- php: '8.2'
os: ubuntu-latest
symfony: '^6.0'
coverage: 'xdebug'
- php: '8.2'
os: windows-latest
symfony: '^6.0'
coverage: 'pcov'
- php: '8.3'
os: ubuntu-latest
symfony: '^6.0'

continue-on-error: ${{ matrix.php == '8.3' }}

steps:
- name: Checkout source
Expand Down Expand Up @@ -79,11 +95,11 @@ jobs:
run: composer config extra.symfony.require ${{ matrix.symfony }}

- name: Update composer dependencies
if: matrix.php != '8.2'
if: matrix.php != '8.3'
run: composer update -o --no-interaction --no-progress ${{ matrix.composer-flags }}

- name: "Update composer dependencies (PHP 8.2, ignore platform)"
if: matrix.php == '8.2'
if: matrix.php == '8.3'
run: composer update -o --no-interaction --no-progress ${{ matrix.composer-flags }} --ignore-platform-req=php+

- name: Run test suite
Expand Down Expand Up @@ -164,6 +180,9 @@ jobs:
- php: '5.5'
- php: '7.2'
- php: '8.0'
- php: '8.3'

continue-on-error: ${{ matrix.php == '8.3' }}

steps:
- name: Checkout
Expand Down

0 comments on commit f08f945

Please sign in to comment.