Skip to content

Commit c462139

Browse files
committed
t
1 parent 0ad3ef0 commit c462139

File tree

4 files changed

+54
-7
lines changed

4 files changed

+54
-7
lines changed

.circleci/config.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ jobs:
120120
docker:
121121
- image: cimg/php:8.2-browsers
122122
environment:
123-
DRUPAL_VERSION: 10@beta
123+
DRUPAL_VERSION: 10.4@beta
124+
CI_PHPSTAN_IGNORE_FAILURE: 1 # PHPStan levels for canary releases are not the same as for this project.
124125
<<: *job-test
125126

126127
test-php-8.3-d10-legacy:
@@ -144,7 +145,8 @@ jobs:
144145
docker:
145146
- image: cimg/php:8.3-browsers
146147
environment:
147-
DRUPAL_VERSION: 10@beta
148+
DRUPAL_VERSION: 10.4@beta
149+
CI_PHPSTAN_IGNORE_FAILURE: 1 # PHPStan levels for canary releases are not the same as for this project.
148150
<<: *job-test
149151

150152
test-php-8.4-d10-legacy:
@@ -168,7 +170,8 @@ jobs:
168170
docker:
169171
- image: cimg/php:8.3-browsers # PHP 8.4 is not available yet.
170172
environment:
171-
DRUPAL_VERSION: 10@beta
173+
DRUPAL_VERSION: 10.4@beta
174+
CI_PHPSTAN_IGNORE_FAILURE: 1 # PHPStan levels for canary releases are not the same as for this project.
172175
<<: *job-test
173176

174177
test-php-8.3-d11-legacy:
@@ -193,6 +196,7 @@ jobs:
193196
- image: cimg/php:8.3-browsers
194197
environment:
195198
DRUPAL_VERSION: 11@beta
199+
CI_PHPSTAN_IGNORE_FAILURE: 1 # PHPStan levels for canary releases are not the same as for this project.
196200
<<: *job-test
197201

198202
test-php-8.4-d11-legacy:
@@ -217,6 +221,7 @@ jobs:
217221
- image: cimg/php:8.3-browsers # PHP 8.4 is not available yet.
218222
environment:
219223
DRUPAL_VERSION: 11@beta
224+
CI_PHPSTAN_IGNORE_FAILURE: 1 # PHPStan levels for canary releases are not the same as for this project.
220225
<<: *job-test
221226

222227
deploy:

.devtools/assemble.sh

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,12 @@ fi
9191
info "Creating Drupal codebase."
9292

9393
drupal_version_major="$(echo "${DRUPAL_VERSION}" | cut -d '.' -f 1 | cut -d '@' -f 1)"
94+
drupal_version_stability="$(echo "${DRUPAL_VERSION}" | sed -n 's/.*@\(.*\)/\1/p')"
95+
drupal_version_stability="${drupal_version_stability:-stable}"
96+
9497
DRUPAL_PROJECT_SHA="${DRUPAL_PROJECT_SHA:-"${drupal_version_major}.x"}"
9598

96-
note "Initialising Drupal site from the scaffold repo ${DRUPAL_PROJECT_REPO} ref ${DRUPAL_PROJECT_SHA}."
99+
note "Initialising Drupal ${DRUPAL_VERSION} site from the scaffold repo ${DRUPAL_PROJECT_REPO} ref ${DRUPAL_PROJECT_SHA}."
97100

98101
# Clone Drupal project at the specific commit SHA.
99102
git clone -n "${DRUPAL_PROJECT_REPO}" "build"
@@ -105,6 +108,18 @@ sed_opts=(-i) && [ "$(uname)" == "Darwin" ] && sed_opts=(-i '')
105108
sed "${sed_opts[@]}" 's|\(.*"drupal\/core.*"\): "\(.*\)",.*|\1: '"\"~$DRUPAL_VERSION\",|" "build/composer.json"
106109
grep '"drupal/core-.*": "' "build/composer.json"
107110

111+
note "Updating stability to ${drupal_version_stability}."
112+
# Do not rely on the values coming from the scaffold and always set them.
113+
sed "${sed_opts[@]}" 's|\(.*"minimum-stability"\): "\(.*\)",.*|\1: '"\"${drupal_version_stability}\",|" "build/composer.json"
114+
grep 'minimum-stability' "build/composer.json"
115+
116+
drupal_version_prefer_stable="true"
117+
if [ "${drupal_version_stability}" != "stable" ]; then
118+
drupal_version_prefer_stable="false"
119+
fi
120+
sed "${sed_opts[@]}" 's|\(.*"prefer-stable"\): \(.*\),.*|\1: '${drupal_version_prefer_stable}',|' "build/composer.json"
121+
grep 'prefer-stable' "build/composer.json"
122+
108123
pass "Drupal codebase created."
109124

110125
info "Merging configuration from composer.dev.json."
@@ -147,6 +162,20 @@ for composer_suggest in $composer_suggests; do
147162
done
148163
pass "Suggested dependencies installed."
149164

165+
# Some versions of Drupal enforce maximum verbosity for errors by default. This
166+
# leads to functional tests failing due to deprecation notices showing up in
167+
# the page output, which is then interpreted as a test failure by PHPUnit.
168+
# To address this, we inject the error_reporting() without deprecations into
169+
# the default.settings.php file used by the system under test. But we do this
170+
# only if the deprecations helper is set to `disable` which means to ignore
171+
# deprecation notices.
172+
# @see https://www.drupal.org/project/drupal/issues/1267246
173+
if [ "${SYMFONY_DEPRECATIONS_HELPER-}" == "disabled" ]; then
174+
info "Disabling deprecation notices in functional tests."
175+
echo "error_reporting(E_ALL & ~E_DEPRECATED);" >>build/web/sites/default/default.settings.php
176+
pass "Deprecation notices disabled."
177+
fi
178+
150179
# If front-end dependencies are used in the project, package-lock.json is
151180
# expected to be committed to the repository.
152181
if [ -f "package-lock.json" ]; then

.github/workflows/scaffold-test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ jobs:
6969
"$(pwd)"/.scaffold-coverage-html \
7070
.scaffold/tests/node_modules/.bin/bats \
7171
.scaffold/tests/bats --filter-tags "${{ matrix.bats-tags }}"
72+
env:
73+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7274

7375
- name: Upload coverage report as an artifact
7476
uses: actions/upload-artifact@v4

.github/workflows/test.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ jobs:
2828

2929
- name: test-php-8.2-d10-canary
3030
php-version: 8.2
31-
drupal-version: 10@beta
31+
drupal-version: 10.4@beta
32+
stability: canary
3233

3334
- name: test-php-8.3-d10-legacy
3435
php-version: 8.3
@@ -40,7 +41,8 @@ jobs:
4041

4142
- name: test-php-8.3-d10-canary
4243
php-version: 8.3
43-
drupal-version: 10@beta
44+
drupal-version: 10.4@beta
45+
stability: canary
4446

4547
- name: test-php-8.4-d10-legacy
4648
php-version: 8.4
@@ -52,7 +54,7 @@ jobs:
5254

5355
- name: test-php-8.4-d10-canary
5456
php-version: 8.4
55-
drupal-version: 10@beta
57+
drupal-version: 10.4@beta
5658

5759
- name: test-php-8.3-d11-legacy
5860
php-version: 8.3
@@ -106,8 +108,16 @@ jobs:
106108
php-version: ${{ matrix.php-version }}
107109
extensions: gd, sqlite, pdo_sqlite
108110

111+
# Disable Symfony deprecations helper for PHP 8.4+ until minor
112+
# versions of Drupal 10 and 11 fully support PHP 8.4.
113+
# @see https://www.drupal.org/project/drupal/issues/1267246
114+
- name: Update SYMFONY_DEPRECATIONS_HELPER for PHP 8.4
115+
run: if [ "${{ matrix.php-version }}" == "8.4" ]; then echo "SYMFONY_DEPRECATIONS_HELPER=disabled" >> "$GITHUB_ENV"; fi
116+
109117
- name: Assemble the codebase
110118
run: .devtools/assemble.sh
119+
env:
120+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
111121

112122
- name: Start built-in PHP server
113123
run: .devtools/start.sh
@@ -122,6 +132,7 @@ jobs:
122132
- name: Lint code with PHPStan
123133
working-directory: build
124134
run: vendor/bin/phpstan || [ "${CI_PHPSTAN_IGNORE_FAILURE:-0}" -eq 1 ]
135+
continue-on-error: ${{ endsWith(matrix.name, 'canary') }} # PHPStan levels for canary releases are not the same as for this project.
125136

126137
- name: Lint code with Rector
127138
working-directory: build

0 commit comments

Comments
 (0)