From 11ad71c61cc91f7679bc387a2c88d9ac16ec5368 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ph=C3=A9na=20Proxima?= Date: Wed, 3 Jul 2024 14:13:41 -0400 Subject: [PATCH 1/3] Test Drupal project compatibility in a matrix --- .../workflows/drupal-recommended-project.yml | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/workflows/drupal-recommended-project.yml b/.github/workflows/drupal-recommended-project.yml index d63285d..7695726 100644 --- a/.github/workflows/drupal-recommended-project.yml +++ b/.github/workflows/drupal-recommended-project.yml @@ -1,4 +1,4 @@ -name: Drupal recommended-project Compatibility +name: Drupal project compatibility on: push: @@ -10,7 +10,16 @@ on: jobs: composer-project: + name: ${{ matrix.template }} on PHP ${{ matrix.php }} runs-on: ubuntu-latest + strategy: + fail-fast: false + max-parallel: 10 + matrix: + php: ['8.1', '8.2', '8.3'] + template: + - recommended-project + - legacy-project steps: - name: Checkout self @@ -21,17 +30,14 @@ jobs: - name: Install PHP and Composer uses: shivammathur/setup-php@v2 with: - php-version: '8.1' + php-version: ${{ matrix.php }} tools: composer:v2 - name: Create Drupal Project run: | - composer create-project drupal/recommended-project project_name - cd project_name - # Set dev stability to allow for php-tuf/php-tuf to be installed. - composer config minimum-stability dev + composer create-project drupal/${{ matrix.template }} project + cd project composer config --no-plugins allow-plugins.php-tuf/composer-integration true composer config github-oauth.github.com ${{ secrets.GITHUB_TOKEN }} - composer config repositories.vcs-php-tuf vcs https://github.com/php-tuf/php-tuf.git composer config repositories.local path ../composer-integration composer require php-tuf/composer-integration:@dev --with-all-dependencies From dd286ac2f92838e65f70408b99c1abf8e5b82f7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ph=C3=A9na=20Proxima?= Date: Wed, 3 Jul 2024 14:16:33 -0400 Subject: [PATCH 2/3] Fix tests --- tests/ApiTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/ApiTest.php b/tests/ApiTest.php index 614fbb4..d0650b1 100644 --- a/tests/ApiTest.php +++ b/tests/ApiTest.php @@ -354,13 +354,13 @@ public function testTargetFromUrl(): void 'repository' => $repository, ] ); - $repository->prepareMetadata($event); + $repository->prepareComposerMetadata($event); $this->assertSame(39, $event->getTransportOptions()['max_file_size']); // If the URL of the metadata doesn't start with the repository URL, // we should fall back to using the URL's path component as the target. $event->setProcessedUrl('http://localhost/another/target.json'); - $repository->prepareMetadata($event); + $repository->prepareComposerMetadata($event); $this->assertSame(59, $event->getTransportOptions()['max_file_size']); } } From 4919f744f472f5cb86af21cbdab97c0d68cb50a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ph=C3=A9na=20Proxima?= Date: Wed, 3 Jul 2024 14:17:39 -0400 Subject: [PATCH 3/3] Minor changes --- .../workflows/{drupal-recommended-project.yml => drupal.yml} | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) rename .github/workflows/{drupal-recommended-project.yml => drupal.yml} (87%) diff --git a/.github/workflows/drupal-recommended-project.yml b/.github/workflows/drupal.yml similarity index 87% rename from .github/workflows/drupal-recommended-project.yml rename to .github/workflows/drupal.yml index 7695726..11682c2 100644 --- a/.github/workflows/drupal-recommended-project.yml +++ b/.github/workflows/drupal.yml @@ -1,4 +1,4 @@ -name: Drupal project compatibility +name: Drupal compatibility on: push: @@ -33,11 +33,10 @@ jobs: php-version: ${{ matrix.php }} tools: composer:v2 - - name: Create Drupal Project + - name: Create Drupal project run: | composer create-project drupal/${{ matrix.template }} project cd project composer config --no-plugins allow-plugins.php-tuf/composer-integration true - composer config github-oauth.github.com ${{ secrets.GITHUB_TOKEN }} composer config repositories.local path ../composer-integration composer require php-tuf/composer-integration:@dev --with-all-dependencies