Skip to content

Commit 6357a4b

Browse files
authored
Merge pull request #172 from PHPCSStandards/feature/ghactions-composer-2.3
GH Actions: add builds against Composer 2.2 for PHP 7.2 - 8.x
2 parents 8fcf10c + 9b9e823 commit 6357a4b

File tree

2 files changed

+43
-1
lines changed

2 files changed

+43
-1
lines changed

.github/workflows/integrationtest.yml

+42
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,48 @@ jobs:
4242
- 'windows-latest'
4343

4444
include:
45+
# Composer 2.3 drops support for PHP < 7.2, so for PHP 5.4 to 7.1, `v2` will install
46+
# Composer 2.2, for PHP 7.2 and up, `v2` will install Composer 2.3.
47+
# These builds make sure the Composer 2.2 LTS version is 100% supported for PHP 7.2-8.x.
48+
- php: '7.2'
49+
composer: '2.2'
50+
os: 'ubuntu-latest'
51+
- php: '7.3'
52+
composer: '2.2'
53+
os: 'ubuntu-latest'
54+
- php: '7.4'
55+
composer: '2.2'
56+
os: 'ubuntu-latest'
57+
- php: '8.0'
58+
composer: '2.2'
59+
os: 'ubuntu-latest'
60+
- php: '8.1'
61+
composer: '2.2'
62+
os: 'ubuntu-latest'
63+
- php: '8.2'
64+
composer: '2.2'
65+
os: 'ubuntu-latest'
66+
67+
- php: '7.2'
68+
composer: '2.2'
69+
os: 'windows-latest'
70+
- php: '7.3'
71+
composer: '2.2'
72+
os: 'windows-latest'
73+
- php: '7.4'
74+
composer: '2.2'
75+
os: 'windows-latest'
76+
- php: '8.0'
77+
composer: '2.2'
78+
os: 'windows-latest'
79+
- php: '8.1'
80+
composer: '2.2'
81+
os: 'windows-latest'
82+
- php: '8.2'
83+
composer: '2.2'
84+
os: 'windows-latest'
85+
86+
# Also test against the dev version of Composer for early warning about upcoming changes.
4587
- php: 'latest'
4688
composer: 'snapshot'
4789
os: 'ubuntu-latest'

tests/bootstrap.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
// Get the version of Composer being used.
115115
$command = '"' . \PHP_BINARY . '" "' . \COMPOSER_PHAR . '" --version --no-ansi --no-interaction';
116116
$lastLine = exec($command, $output, $exitcode);
117-
if ($exitcode === 0 && preg_match('`Composer version ([^\s]+)`', $lastLine, $matches) === 1) {
117+
if ($exitcode === 0 && preg_match('`Composer (?:version )?([^\s]+)`', $lastLine, $matches) === 1) {
118118
define('COMPOSER_VERSION', $matches[1]);
119119
} else {
120120
echo 'Could not determine the version of Composer being used.';

0 commit comments

Comments
 (0)