Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#660] Fixed required Composer version constraint and added a CI job. #664

Merged
merged 1 commit into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,26 @@ jobs:

- name: Run a single unit test to verify the testing setup
run: ./vendor/bin/phpunit -c ./web/core $(pwd)/web/core/modules/user/tests/src/Unit/UserAccessControlHandlerTest.php

# Using outdated Composer version to test the Composer version constraint.
test-composer:
runs-on: ubuntu-latest

steps:

- name: Checkout
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
extensions: gd, pdo_sqlite
tools: composer:v2.2

- name: Show Composer version
run: composer --version

- name: Install dependencies
# This command should fail because of the Composer version constraint.
run: composer --verbose install && exit 1 || exit 0
4 changes: 2 additions & 2 deletions scripts/composer/ScriptHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ public static function checkComposerVersion(Event $event) {
if ($version === '@package_version@' || $version === '@package_branch_alias_version@') {
$io->writeError('<warning>You are running a development version of Composer. If you experience problems, please update Composer to the latest stable version.</warning>');
}
elseif (Comparator::lessThan($version, '1.0.0')) {
$io->writeError('<error>Drupal-project requires Composer version 1.0.0 or higher. Please update your Composer before continuing</error>.');
elseif (Comparator::lessThan($version, '2.3.6')) {
$io->writeError('<error>Drupal-project requires Composer version 2.3.6 or higher. Please update your Composer before continuing</error>.');
exit(1);
}
}
Expand Down
Loading