Skip to content

Commit

Permalink
GH Actions: update PHP versions in workflows
Browse files Browse the repository at this point in the history
PHP 8.2 has been released today 🎉 and the `setup-php` action has announced support for PHP 8.3, so adding PHP 8.3 to the matrix and no longer allowing PHP 8.2 to fail the build.

Builds against PHP 8.3 are still allowed to fail for now.

Includes updating the `PHPCSVersions` class for the test suite to contain a PHP `8.3` block and updating the PHPCS table to include the latest releases. (we should automate that)
  • Loading branch information
jrfnl committed Dec 8, 2022
1 parent a5829f2 commit 427ff57
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/integrationtest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jobs:
- '8.0'
- '8.1'
- '8.2'
- '8.3'
composer:
- 'v1'
- 'v2'
Expand Down Expand Up @@ -70,6 +71,9 @@ jobs:
- php: '8.2'
composer: '2.2'
os: 'ubuntu-latest'
- php: '8.3'
composer: '2.2'
os: 'ubuntu-latest'

- php: '7.2'
composer: '2.2'
Expand All @@ -89,6 +93,9 @@ jobs:
- php: '8.2'
composer: '2.2'
os: 'windows-latest'
- php: '8.3'
composer: '2.2'
os: 'windows-latest'

# Also test against the dev version of Composer for early warning about upcoming changes.
- php: 'latest'
Expand All @@ -101,7 +108,7 @@ jobs:

name: "Integration test"

continue-on-error: ${{ matrix.php == '8.2' || matrix.composer == 'snapshot' }}
continue-on-error: ${{ matrix.php == '8.3' || matrix.composer == 'snapshot' }}

steps:
- name: Checkout code
Expand All @@ -123,15 +130,15 @@ jobs:
# Install dependencies and handle caching in one go.
# @link https://github.com/marketplace/actions/install-composer-dependencies
- name: Install Composer dependencies
if: ${{ matrix.php != '8.2' }}
if: ${{ matrix.php != '8.3' }}
uses: "ramsey/composer-install@v2"
with:
composer-options: '--optimize-autoloader'
# Bust the cache at least once a month - output format: YYYY-MM-DD.
custom-cache-suffix: $(date -u -d "-0 month -$(($(date +%d)-1)) days" "+%F")

- name: Install Composer dependencies
if: ${{ matrix.php == '8.2' }}
if: ${{ matrix.php == '8.3' }}
uses: "ramsey/composer-install@v2"
with:
composer-options: '--ignore-platform-reqs --optimize-autoloader'
Expand Down
12 changes: 12 additions & 0 deletions tests/PHPCSVersions.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ final class PHPCSVersions
'3.6.0' => '3.6.0',
'3.6.1' => '3.6.1',
'3.6.2' => '3.6.2',
'3.7.0' => '3.7.0',
'3.7.1' => '3.7.1',
);

/**
Expand Down Expand Up @@ -342,6 +344,16 @@ function ($version) {
break;

case '8.2':
$versions = array_filter(
self::$allPhpcsVersions,
function ($version) {
// PHPCS 3.6.1 is the first PHPCS version with runtime support for PHP 8.2.
return version_compare($version, '3.6.1', '>=');
}
);
break;

case '8.3':
/*
* At this point in time, it is unclear as of which PHPCS version PHP 8.2 will be supported.
* In other words: tests should only use dev-master/4.x when on PHP 8.2 for the time being.
Expand Down

0 comments on commit 427ff57

Please sign in to comment.