-
Notifications
You must be signed in to change notification settings - Fork 939
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
[10.x] Re-formatted CI and added more PHP versions to the test matrix. #654
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,10 @@ name: CI | |
on: | ||
push: | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
types: | ||
- opened | ||
- synchronize | ||
- reopened | ||
|
||
env: | ||
COMPOSER_MEMORY_LIMIT: -1 | ||
|
@@ -15,17 +18,21 @@ jobs: | |
runs-on: 'ubuntu-20.04' | ||
strategy: | ||
fail-fast: false | ||
|
||
matrix: | ||
php-versions: ['8.1'] | ||
drupal-release: ['stable'] | ||
composer-channel: ['stable'] | ||
php-versions: ['8.1', '8.2'] | ||
drupal-release: ['stable', 'dev'] | ||
composer-channel: ['stable', 'snapshot'] | ||
# Drupal 10.x-dev tests fail on PHP 8.3. | ||
# @see https://www.drupal.org/project/drupal/issues/3375693 | ||
include: | ||
- php-versions: '8.1' | ||
drupal-release: dev | ||
composer-channel: stable | ||
- php-versions: '8.1' | ||
drupal-release: stable | ||
composer-channel: snapshot | ||
- php-versions: '8.3' | ||
drupal-release: 'stable' | ||
composer-channel: 'stable' | ||
- php-versions: '8.3' | ||
drupal-release: 'stable' | ||
composer-channel: 'snapshot' | ||
|
||
steps: | ||
- name: Dump matrix context | ||
env: | ||
|
@@ -41,10 +48,10 @@ jobs: | |
php-version: ${{ matrix.php-versions }} | ||
extensions: gd, pdo_sqlite | ||
|
||
- name: Update composer | ||
- name: Update Composer | ||
run: composer --verbose self-update --${{ matrix.composer-channel }} | ||
|
||
- name: Dump composer version | ||
- name: Show Composer version | ||
run: composer --version | ||
|
||
- name: Validate composer.json | ||
|
@@ -53,24 +60,25 @@ jobs: | |
- name: Install dependencies | ||
run: composer --verbose install | ||
|
||
- if: matrix.drupal-release == 'dev' | ||
run: composer --verbose require --no-update drupal/core-recommended:10.0.x-dev && composer --verbose require --no-update --dev drupal/core-dev:10.0.x-dev | ||
|
||
- if: matrix.drupal-release == 'dev' | ||
run: composer --verbose update | ||
# @see https://www.drupal.org/node/3176567 | ||
- name: Install testing dependency | ||
if: ${{ matrix.php-versions == '8.1' }} | ||
run: composer require --dev phpspec/prophecy-phpunit:^2 | ||
|
||
- run: ./vendor/bin/drush site-install --verbose --yes --db-url=sqlite://tmp/site.sqlite | ||
- name: Override Drupal version to dev for testing dev releases | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is a single operation, so combined multiple steps |
||
if: matrix.drupal-release == 'dev' | ||
run: | | ||
composer --verbose require --no-update drupal/core-recommended:10.0.x-dev | ||
composer --verbose require --no-update --dev drupal/core-dev:10.0.x-dev | ||
composer --verbose update | ||
|
||
- run: ./vendor/bin/drush runserver $SIMPLETEST_BASE_URL & | ||
- name: Install site | ||
run: ./vendor/bin/drush site-install --verbose --yes --db-url=sqlite://tmp/site.sqlite | ||
|
||
- run: until curl -s $SIMPLETEST_BASE_URL; do true; done > /dev/null | ||
- name: Start server | ||
run: | | ||
./vendor/bin/drush runserver "$SIMPLETEST_BASE_URL" & | ||
until curl -s "$SIMPLETEST_BASE_URL"; do true; done > /dev/null | ||
|
||
# https://www.drupal.org/project/drupal/issues/3182653 | ||
# https://www.drupal.org/node/3176567 | ||
- if: ${{ matrix.php-versions == '8.1' }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. moved above to the part where all of the code base is prepared |
||
run: composer require phpspec/prophecy-phpunit:^2 | ||
|
||
- name: Run a single unit test to verify the testing setup. | ||
- name: Run a single unit test to verify the testing setup | ||
run: ./vendor/bin/phpunit -c ./web/core ./web/core/modules/user/tests/src/Unit/UserAccessControlHandlerTest.php | ||
|
||
- run: ./vendor/bin/drush | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is not needed - Drush was used above to install the site and run the server |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.