Skip to content

Commit 13ac14d

Browse files
committed
[#660] Fixed required Composer version constraint and added a CI job.
1 parent b13ddf5 commit 13ac14d

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

.github/workflows/ci.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,26 @@ jobs:
8080
8181
- name: Run a single unit test to verify the testing setup
8282
run: ./vendor/bin/phpunit -c ./web/core $(pwd)/web/core/modules/user/tests/src/Unit/UserAccessControlHandlerTest.php
83+
84+
# Using outdated Composer version to test the Composer version constraint.
85+
test-composer:
86+
runs-on: ubuntu-latest
87+
88+
steps:
89+
90+
- name: Checkout
91+
uses: actions/checkout@v2
92+
93+
- name: Setup PHP
94+
uses: shivammathur/setup-php@v2
95+
with:
96+
php-version: 8.2
97+
extensions: gd, pdo_sqlite
98+
tools: composer:v2.2
99+
100+
- name: Show Composer version
101+
run: composer --version
102+
103+
- name: Install dependencies
104+
# This command should fail because of the Composer version constraint.
105+
run: composer --verbose install && exit 1 || exit 0

scripts/composer/ScriptHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ public static function checkComposerVersion(Event $event) {
9292
if ($version === '@package_version@' || $version === '@package_branch_alias_version@') {
9393
$io->writeError('<warning>You are running a development version of Composer. If you experience problems, please update Composer to the latest stable version.</warning>');
9494
}
95-
elseif (Comparator::lessThan($version, '1.0.0')) {
96-
$io->writeError('<error>Drupal-project requires Composer version 1.0.0 or higher. Please update your Composer before continuing</error>.');
95+
elseif (Comparator::lessThan($version, '2.3.6')) {
96+
$io->writeError('<error>Drupal-project requires Composer version 2.3.6 or higher. Please update your Composer before continuing</error>.');
9797
exit(1);
9898
}
9999
}

0 commit comments

Comments
 (0)