Skip to content

Commit

Permalink
PHP 8.1 compatibility round 2 (#3932)
Browse files Browse the repository at this point in the history
13523/14184
  • Loading branch information
paul-m authored Apr 4, 2023
1 parent bf3a4b8 commit 41ee536
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 43 deletions.
66 changes: 24 additions & 42 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ commands:
description: 'Repo branch name for the dkan-ddev-addon you want to test against.'
default: 'main'
type: string
dkan_recommended_branch:
description: 'Branch of getdkan/recommended-project to use.'
default: '9.5.x-dev'
type: string
steps:
- run:
name: Set up composer config
Expand All @@ -54,33 +58,11 @@ commands:
echo "omit_containers: [dba]" >> .ddev/config.dkan.yaml
ddev restart
ddev status
ddev dkan-init --force
ddev dkan-init --project-version << parameters.dkan_recommended_branch>> --force
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
mkdir -p test_results
prepare_drupal_core:
# TODO: Hopefully getdkan/recommended-project will have tagged releases at some point.
parameters:
drupal_core_constraint:
description: 'Drupal core version to use as a Composer constraint.'
default: '~9.5.0'
type: string
steps:
- run:
name: Use Drupal core version
command: |
ddev composer show "drupal/core*" --no-ansi
# Remove drupal/core-recommended and swap for drupal/core so that
# we can install core 9.5 using PHP 8.1. (Guzzle would block otherwise.)
ddev composer remove drupal/core-recommended --no-update
ddev composer require drupal/core-composer-scaffold:<< parameters.drupal_core_constraint >> --no-update
ddev composer require drupal/core-project-message:<< parameters.drupal_core_constraint >> --no-update
ddev composer require drupal/core:<< parameters.drupal_core_constraint >> --no-update
ddev composer require --dev drupal/core-dev:<< parameters.drupal_core_constraint >> --no-update
ddev composer update --no-audit
ddev composer show "drupal/core*" --no-ansi
prepare_site:
parameters:
upgrade:
Expand Down Expand Up @@ -141,9 +123,9 @@ jobs:
description: 'PHP major.minor for DDev to use.'
default: '8.0'
type: string
drupal_core_constraint:
description: 'Drupal core version to use as a Composer constraint.'
default: '~9.5.0'
dkan_recommended_branch:
description: 'Branch of getdkan/recommended-project to use.'
default: '9.5.x-dev'
type: string
report_coverage:
description: 'Generate coverage report and send it to CodeClimate'
Expand All @@ -157,8 +139,7 @@ jobs:
- docker/install-docker-tools
- prepare_build:
php_version: << parameters.php_version >>
- prepare_drupal_core:
drupal_core_constraint: << parameters.drupal_core_constraint >>
dkan_recommended_branch: << parameters.dkan_recommended_branch >>
- prepare_site:
upgrade: << parameters.upgrade >>
needs_cypress: false
Expand Down Expand Up @@ -210,9 +191,9 @@ jobs:
description: 'PHP major.minor for DDev to use.'
default: '8.0'
type: string
drupal_core_constraint:
description: 'Drupal core version to use as a Composer constraint.'
default: '~9.5.0'
dkan_recommended_branch:
description: 'Branch of getdkan/recommended-project to use.'
default: '9.5.x-dev'
type: string
upgrade:
description: 'If true, will install the latest stable DKAN version and test upgrade'
Expand All @@ -222,8 +203,7 @@ jobs:
- docker/install-docker-tools
- prepare_build:
php_version: << parameters.php_version >>
- prepare_drupal_core:
drupal_core_constraint: << parameters.drupal_core_constraint >>
dkan_recommended_branch: << parameters.dkan_recommended_branch >>
- prepare_site:
upgrade: << parameters.upgrade >>
needs_cypress: true
Expand Down Expand Up @@ -253,37 +233,39 @@ workflows:
jobs:
- cypress:
name: install_test_cypress
dkan_recommended_branch: '9.5.x-dev'
- phpunit:
matrix:
parameters:
drupal_core_constraint: [ '~9.4.0' ]
dkan_recommended_branch: [ '9.4.x-dev']
php_version: [ '7.4' ]
- phpunit:
matrix:
parameters:
drupal_core_constraint: [ '~9.5.0' ]
dkan_recommended_branch: [ '9.5.x-dev']
php_version: [ '7.4', '8.1' ]
- phpunit:
name: 'Install target (Drupal 9.5, PHP 8.0)'
report_coverage: true
matrix:
parameters:
drupal_core_constraint: [ '~9.5.0' ]
dkan_recommended_branch: [ '9.5.x-dev']
php_version: [ '8.0' ]
# - phpunit:
# matrix:
# parameters:
# drupal_core_constraint: [ '~10.0.0' ]
# php_version: [ '8.1' ]
# - phpunit:
# matrix:
# parameters:
# dkan_recommended_branch: [ '10.0.x-dev']
# php_version: [ '8.1' ]
upgrade_and_test:
jobs:
- cypress:
name: upgrade_test_cypress
upgrade: true
dkan_recommended_branch: '9.5.x-dev'
- phpunit:
name: 'Upgrade target (Drupal 9.5, PHP 8.0)'
upgrade: true
matrix:
parameters:
drupal_core_constraint: [ '~9.5.0' ]
dkan_recommended_branch: [ '9.5.x-dev']
php_version: [ '8.0' ]
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"description": "DKAN Open Data Catalog",
"require": {
"drupal/admin_toolbar": "^3",
"drupal/config_update": "^2@dev",
"drupal/config_update": "^1.7 || 2.x-dev",
"drupal/moderated_content_bulk_publish": "~2.0.20",
"drupal/search_api": "^1.15",
"drupal/select_or_other": "dev-4.x#ae0585ff8c",
Expand Down

0 comments on commit 41ee536

Please sign in to comment.