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

Test Drupal project compatibility in a matrix of template projects and PHP versions #113

Merged
merged 4 commits into from
Jul 3, 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
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: |
phenaproxima marked this conversation as resolved.
Show resolved Hide resolved
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']);
}
}
Loading