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

Workflow updates for Drupal 11 upgrade #1094

Open
wants to merge 12 commits into
base: 4.x
Choose a base branch
from
38 changes: 13 additions & 25 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,25 @@ on:
jobs:
build:

runs-on: ubuntu-latest
runs-on: ubuntu-24.04

name: "PHP ${{ matrix.php-version }} | Drupal ${{ matrix.drupal-core }} | ${{ matrix.instance-type }}"
strategy:
fail-fast: false
matrix:
php-version:
- "8.1"
- "8.2"
- "8.3"
drupal-core:
# Should update the following as the minimum supported version from Drupal.org
- "10.2.x"
- "10.3.x"
- "11.0.x"
instance-type:
- "Edge"
- "X"
exclude:
- php-version: "8.2"
drupal-core: "11.0.x"

steps:

Expand All @@ -57,7 +59,7 @@ jobs:
coverage: "xdebug"
php-version: "${{ matrix.php-version }}"
tools: composer:v2
extensions: dom, curl, libxml, mbstring, zip, pdo, mysql, pdo_mysql, bcmath, gd, exif, iconv, opcache, imagick
extensions: date, dom, filter, hash, json, curl, libxml, mbstring, zip, pdo, sqlite3, mysqli, mysql, pdo_mysql, bcmath, gd, exif, iconv, opcache, imagick, openssl

- name: Checkout Drupal core
run: |
Expand Down Expand Up @@ -95,29 +97,16 @@ jobs:
composer config --no-plugins allow-plugins.cweagans/composer-patches true
composer config --no-plugins allow-plugins.php-http/discovery true
composer config minimum-stability dev
composer require 'drupal/rules:^4.0'
composer require wikimedia/composer-merge-plugin
composer config --json extra.merge-plugin.require '["modules/contrib/apigee_edge/composer.json"]'
composer config platform.php ${{ matrix.php-version }}
composer config --json extra.patches."drupal/core" '{ "Support entities that are neither content nor config entities": "https://www.drupal.org/files/issues/2020-12-02/3042467-50.patch", "Add a method to access the original property": "https://www.drupal.org/files/issues/2023-07-22/2839195-105.patch"}'
# composer config --json extra.patches."drupal/core" '{ "Support entities that are neither content nor config entities": "https://www.drupal.org/files/issues/2020-12-02/3042467-50.patch", "Drupal 11 compatibility for classy": "https://www.drupal.org/files/issues/2024-08-26/classy-3461089-5.patch"}'
composer update --with-all-dependencies
composer require --dev phpspec/prophecy-phpunit:^2
composer require --dev drupal/classy:^1.0
# composer require --dev drupal/olivero
composer config --no-plugins allow-plugins.drupal/console-extend-plugin true

- name: "Allow plugins and dev dependencies for Drupal 10.2"
if: ${{ matrix.drupal-core == '10.2.x' }}
run: |
cd drupal
composer require 'drupal/rules:3.x-dev@dev'
composer update --with-all-dependencies

- name: "Allow plugins and dev dependencies for Drupal 10.3"
if: ${{ matrix.drupal-core == '10.3.x' }}
run: |
cd drupal
composer require 'drupal/rules:^4.0'
composer update --with-all-dependencies

# Install drupal using minimal installation profile and enable the module.
- name: Install Drupal
run: |
Expand All @@ -138,8 +127,7 @@ jobs:
echo "APIGEE_EDGE_ENDPOINT=$APIGEE_EDGE_HYBRID_ENDPOINT" >> $GITHUB_ENV
composer show > composer-show.txt

- name: "Drupal check for Drupal 10.2"
if: ${{ matrix.drupal-core == '10.2.x' }}
- name: "Drupal check"
run: |
cd drupal
vendor/bin/drupal-check modules/contrib/apigee_edge
Expand All @@ -152,13 +140,13 @@ jobs:
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & # optional

- name: "Run PHPUnit tests"
if: ${{ matrix.drupal-core != '10.2.x' || matrix.php-version != '8.2' }}
if: ${{ matrix.drupal-core != '10.3.x' || matrix.php-version != '8.3' }}
run: |
cd drupal
vendor/bin/phpunit -c core --verbose --color --group apigee_edge --testsuite unit,kernel,functional,functional-javascript modules/contrib/apigee_edge

- name: "Run PHPUnit tests with Code Coverage"
if: ${{ matrix.drupal-core == '10.2.x' && matrix.php-version == '8.2' }}
if: ${{ matrix.drupal-core == '10.3.x' && matrix.php-version == '8.3' }}
run: |
cd drupal
cp modules/contrib/apigee_edge/phpunit.core.xml.dist core/phpunit.xml
Expand All @@ -172,7 +160,7 @@ jobs:
path: drupal/sites/simpletest/browser_output/*

- name: Upload coverage to Codecov
if: ${{ matrix.drupal-core == '10.2.x' && matrix.php-version == '8.2' }}
if: ${{ matrix.drupal-core == '10.3.x' && matrix.php-version == '8.3' }}
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
Expand Down
17 changes: 8 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,20 @@
"type": "drupal-module",
"description": "Apigee for Drupal.",
"require": {
"php": "~8.1.0 || ~8.2.0 || ~8.3.0",
"php": "~8.2.0 || ~8.3.0",
"ext-json": "*",
"apigee/apigee-client-php": "~3.0.7",
"drupal/core": "^10.2",
"apigee/apigee-client-php": "4.x-dev",
"drupal/core": "^10.3 || ^11.0",
"drupal/entity": "^1.0",
"drupal/key": "^1.8",
"php-http/guzzle7-adapter": "^1.0"
},
"require-dev": {
"apigee/apigee-mock-client-php": "^1.1.2",
"drupal/drupal-extension": "^4.2.1 || ~5",
"cweagans/composer-patches": "^1.6",
"drupal/core-dev": "^10.2",
"drush/drush": "^12.4.3",
"mglaman/drupal-check": "1.3",
"cweagans/composer-patches": "^1.7.3",
"drupal/core-dev": "^10.3 || ^11.0",
"drush/drush": "^13.3.0",
"mglaman/drupal-check": "1.5",
"phpmd/phpmd": "^2.8.2",
"phpmetrics/phpmetrics": "^2.5",
"phpstan/phpstan": "^1.5"
Expand All @@ -31,7 +30,7 @@
"extra": {
"drush": {
"services": {
"drush.services.yml": "^12"
"drush.services.yml": "^13"
}
}
}
Expand Down
Loading