Skip to content

Commit

Permalink
Test Drupal project compatibility in a matrix of template projects an…
Browse files Browse the repository at this point in the history
…d PHP versions (#113)
  • Loading branch information
phenaproxima authored Jul 3, 2024
1 parent fee2346 commit edb9df2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Drupal recommended-project Compatibility
name: Drupal compatibility

on:
push:
Expand All @@ -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
Expand All @@ -21,17 +30,13 @@ 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
- 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
4 changes: 2 additions & 2 deletions tests/ApiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
}
}

0 comments on commit edb9df2

Please sign in to comment.