Skip to content

Commit 48dd092

Browse files
committed
Updated action to install drupal 10
1 parent c7035fa commit 48dd092

File tree

3 files changed

+32
-16
lines changed

3 files changed

+32
-16
lines changed

.github/workflows/pr.yaml

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,11 @@ jobs:
8484
composer coding-standards-check/phpcs
8585
8686
php-code-analysis:
87-
name: PHP - Code analysis
87+
name: PHP code analysis
8888
runs-on: ubuntu-latest
8989
strategy:
9090
matrix:
9191
php-versions: [ '8.1' ]
92-
dependency-version: [ prefer-lowest, prefer-stable ]
9392
steps:
9493
- uses: actions/checkout@master
9594
- name: Setup PHP, with composer and extensions
@@ -113,27 +112,31 @@ jobs:
113112
run: |
114113
# We need a Drupal project to run drupal-check (cf. https://github.com/mglaman/drupal-check#usage)
115114
# Install Drupal
116-
composer --no-interaction create-project drupal/recommended-project:^9 --stability=dev drupal
115+
composer --no-interaction create-project drupal/recommended-project:^10 drupal
117116
# Copy our module source code into the Drupal module folder.
118117
mkdir -p drupal/web/modules/contrib/os2forms_user_field_lookup
119118
cp -r os2forms_user_field_lookup.* composer.json src drupal/web/modules/contrib/os2forms_user_field_lookup
119+
120+
composer --working-dir=drupal --no-interaction config minimum-stability dev
121+
122+
# Allow all plugins
123+
composer --working-dir=drupal config --no-plugins allow-plugins true
124+
120125
# Add our module as a composer repository.
121-
composer --no-interaction --working-dir=drupal config repositories.itk-dev/os2forms_user_field_lookup path web/modules/contrib/os2forms_user_field_lookup
126+
composer --working-dir=drupal --no-interaction config --append repositories.itk-dev/os2forms_user_field_lookup path web/modules/contrib/os2forms_user_field_lookup
122127
# Restore Drupal composer repository.
123-
composer --no-interaction --working-dir=drupal config repositories.drupal composer https://packages.drupal.org/8
124-
125-
composer --no-interaction --working-dir=drupal config --no-plugins allow-plugins.cweagans/composer-patches true
126-
composer --no-interaction --working-dir=drupal config --no-plugins allow-plugins.zaporylie/composer-drupal-optimizations true
127-
composer --no-interaction --working-dir=drupal config --no-plugins allow-plugins.simplesamlphp/composer-module-installer true
128-
129-
# @see https://getcomposer.org/doc/03-cli.md#modifying-extra-values
130-
composer --no-interaction --working-dir=drupal config --no-plugins --json extra.enable-patching true
128+
# composer --working-dir=drupal --no-interaction config --append repositories.drupal composer https://packages.drupal.org/8
129+
130+
# Make Drupal 10 compatible
131+
composer --working-dir=drupal --no-interaction require psr/http-message:^1.0
132+
composer --working-dir=drupal --no-interaction require 'mglaman/composer-drupal-lenient'
133+
composer --working-dir=drupal config --no-plugins --merge --json extra.drupal-lenient.allowed-list '["drupal/coc_forms_auto_export", "drupal/webform_node_element"]'
131134
132135
# Require our module.
133-
composer --no-interaction --working-dir=drupal require 'itk-dev/os2forms_user_field_lookup:*'
134-
136+
composer --working-dir=drupal --no-interaction require 'itk-dev/os2forms_user_field_lookup:*'
137+
135138
# Check code
136-
composer --no-interaction --working-dir=drupal require --dev drupal/core-dev
139+
composer --working-dir=drupal --no-interaction require --dev drupal/core-dev
137140
cd drupal/web/modules/contrib/os2forms_user_field_lookup
138141
# Remove our non-dev dependencies to prevent duplicated Drupal installation
139142
# PHP Fatal error: Cannot redeclare drupal_get_filename() (previously declared in /home/runner/work/os2forms_user_field_lookup/os2forms_user_field_lookup/drupal/web/modules/contrib/os2forms_user_field_lookup/vendor/drupal/core/includes/bootstrap.inc:190) in /home/runner/work/os2forms_user_field_lookup/os2forms_user_field_lookup/drupal/web/core/includes/bootstrap.inc on line 190

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ about writing changes to this log.
88

99
## [Unreleased]
1010

11-
## [1.1.0]
11+
## [1.1.0] 2024-09-12
1212

1313
- Drupal 10 compatibility.
1414
- Added GitHub Actions.

composer.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,19 @@
3434
"simplesamlphp/composer-module-installer": true
3535
}
3636
},
37+
"extra": {
38+
"patches": {
39+
"drupal/webform_node_element": {
40+
"3290637 - Automated Drupal 10 compatibility fixes": "https://www.drupal.org/files/issues/2023-05-12/webform_node_element_d10-3290637-11.patch"
41+
}
42+
},
43+
"drupal-lenient": {
44+
"allowed-list": [
45+
"drupal/coc_forms_auto_export",
46+
"drupal/webform_node_element"
47+
]
48+
}
49+
},
3750
"scripts": {
3851
"code-analysis/drupal-check": [
3952
"vendor/bin/drupal-check --deprecations --analysis --exclude-dir=vendor *.* src"

0 commit comments

Comments
 (0)