Skip to content

Commit

Permalink
Merge pull request #172 from PHPCSStandards/feature/ghactions-compose…
Browse files Browse the repository at this point in the history
…r-2.3

GH Actions: add builds against Composer 2.2 for PHP 7.2 - 8.x
  • Loading branch information
Potherca committed Apr 18, 2022
2 parents 8fcf10c + 9b9e823 commit 6357a4b
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
42 changes: 42 additions & 0 deletions .github/workflows/integrationtest.yml
Expand Up @@ -42,6 +42,48 @@ jobs:
- 'windows-latest'

include:
# Composer 2.3 drops support for PHP < 7.2, so for PHP 5.4 to 7.1, `v2` will install
# Composer 2.2, for PHP 7.2 and up, `v2` will install Composer 2.3.
# These builds make sure the Composer 2.2 LTS version is 100% supported for PHP 7.2-8.x.
- php: '7.2'
composer: '2.2'
os: 'ubuntu-latest'
- php: '7.3'
composer: '2.2'
os: 'ubuntu-latest'
- php: '7.4'
composer: '2.2'
os: 'ubuntu-latest'
- php: '8.0'
composer: '2.2'
os: 'ubuntu-latest'
- php: '8.1'
composer: '2.2'
os: 'ubuntu-latest'
- php: '8.2'
composer: '2.2'
os: 'ubuntu-latest'

- php: '7.2'
composer: '2.2'
os: 'windows-latest'
- php: '7.3'
composer: '2.2'
os: 'windows-latest'
- php: '7.4'
composer: '2.2'
os: 'windows-latest'
- php: '8.0'
composer: '2.2'
os: 'windows-latest'
- php: '8.1'
composer: '2.2'
os: 'windows-latest'
- php: '8.2'
composer: '2.2'
os: 'windows-latest'

# Also test against the dev version of Composer for early warning about upcoming changes.
- php: 'latest'
composer: 'snapshot'
os: 'ubuntu-latest'
Expand Down
2 changes: 1 addition & 1 deletion tests/bootstrap.php
Expand Up @@ -114,7 +114,7 @@
// Get the version of Composer being used.
$command = '"' . \PHP_BINARY . '" "' . \COMPOSER_PHAR . '" --version --no-ansi --no-interaction';
$lastLine = exec($command, $output, $exitcode);
if ($exitcode === 0 && preg_match('`Composer version ([^\s]+)`', $lastLine, $matches) === 1) {
if ($exitcode === 0 && preg_match('`Composer (?:version )?([^\s]+)`', $lastLine, $matches) === 1) {
define('COMPOSER_VERSION', $matches[1]);
} else {
echo 'Could not determine the version of Composer being used.';
Expand Down

0 comments on commit 6357a4b

Please sign in to comment.