From fc4e33e6d6867d6d5b993cd65a3c08926175eb76 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Wed, 16 Mar 2022 10:28:08 +0100 Subject: [PATCH 1/2] GH Actions: add builds against Composer 2.2 for PHP 7.2 - 8.x 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 extra builds make sure the Composer 2.2 LTS version will continue to be 100% supported for PHP 7.2-8.x. --- .github/workflows/integrationtest.yml | 42 +++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/.github/workflows/integrationtest.yml b/.github/workflows/integrationtest.yml index 1605919e..a5941bab 100644 --- a/.github/workflows/integrationtest.yml +++ b/.github/workflows/integrationtest.yml @@ -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' From 9b9e823ca54459edbcfd394d528df0aabee2ff09 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Wed, 30 Mar 2022 15:07:19 +0200 Subject: [PATCH 2/2] Test bootstrap: tweak the version determination regex Apparently, Composer 2.3.0 dropped the word `version` from the `--version` output ;-) Output on Composer 2.2 and lower: ``` Composer version 2.2.10 2022-03-29 21:55:35 ``` Composer 2.3 output: ``` Composer 2.3.0 2022-03-30 11:15:36 ``` --- tests/bootstrap.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 52c18a2a..67ae4650 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -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.';