Skip to content

Repair wp/5.5 branch Actions: Add a PHP-version test matrix - #338

Closed
desrosj wants to merge 1 commit into
fix-actions-5.5/fix-puppeteer-alias-lockfile-driftfrom
fix-actions-5.5/update-php-test-matrix
Closed

desrosj wants to merge 1 commit into
fix-actions-5.5/fix-puppeteer-alias-lockfile-driftfrom
fix-actions-5.5/update-php-test-matrix

Conversation

@desrosj

@desrosj desrosj commented Sep 13, 2026 •

Copy link
Copy Markdown
Owner

What?

Runs the PHPUnit job in unit-test.yml across a PHP version matrix: 5.6, 7.0 and 7.4, each as a single site and a multisite leg.

  • LOCAL_PHP is set to <version>-fpm from the matrix, so wp-env's phpunit container uses the wordpressdevelop/phpunit:<version>-fpm image.
  • The single npm run test-php && npm run test-unit-php-multisite step is split into a single site step and a multisite step, each running in its own leg.

Why?

The job ran PHPUnit once, in the wordpressdevelop/phpunit:latest image, so it never tested the PHP versions WordPress 5.5 supports. The matrix tests the lowest and highest supported minor version of each major PHP version WordPress 5.5 supports: 5.6 for PHP 5, and 7.0 and 7.4 for PHP 7. WordPress 5.5 doesn't support PHP 8.

How?

This branch's @wordpress/env (1.6.0) has no WP_ENV_PHP_VERSION support, and its wordpress and wordpress:cli images aren't versioned. Its phpunit service image is wordpressdevelop/phpunit:${LOCAL_PHP-latest}, and wp-env run passes the job's environment through to docker compose, so LOCAL_PHP selects the PHP version PHPUnit runs on. The WordPress containers still run on the floating wordpress images' PHP version.

test-php runs lint-php before the tests, so linting runs once per PHP version, on the single site leg. #517 moves PHP coding standards checks into their own job.

Use of AI Tools

This PR was created by Claude Code under my supervision. All code should be treated as AI-produced and not yet reviewed by a human until this PR is marked Ready for Review.

@desrosj desrosj self-assigned this Sep 13, 2026
@desrosj
desrosj added this pull request to stack #167 September 13, 2026 03:55
@desrosj
desrosj force-pushed the fix-actions-5.5/update-php-test-matrix branch from 7907d32 to cdb5a93 Compare September 13, 2026 04:02
@desrosj
desrosj force-pushed the fix-actions-5.5/update-php-test-matrix branch from cdb5a93 to 8b9d4df Compare September 14, 2026 01:41
desrosj added a commit that referenced this pull request Sep 14, 2026
`bundle-size.yml`'s `Check` job never had a Node.js version pin of any
kind (confirmed against the real upstream `wp/5.5` history -- this gap
predates this project's stack entirely, unlike every other workflow file
on this branch, which the `single-node-version-testing` layer (#166)
already pinned via `actions/setup-node`'s `node-version-file: '.nvmrc'`).

`preactjs/compressed-size-action` runs its own internal `npm ci` for
both the PR's head and base commits, using whatever Node.js version the
runner defaults to when no `actions/setup-node` step precedes it. On the
current `ubuntu-24.04` runner image that default has drifted to Node.js
22.x, which is incompatible with several of this era's git-dependency
`prepare` scripts -- confirmed via a real CI run on PR #338
(https://github.com/desrosj/gutenberg/actions/runs/34736948068/job/103669957891):
`react-native-svg@9.13.6-gb`'s `bob build` (via `flowgen`/Babel) throws
`SyntaxError: ... Missing initializer in const declaration` parsing a
type-only `export const` in `src/index.d.ts`, a construct npm's bundled
tooling under Node 22 chokes on but which is a non-issue under this
branch's own pinned Node.js version. Every other job on this same PR
(`JavaScript`, `PHP`, `Admin - 1..4`), which already set up Node via
`.nvmrc` before running `npm ci`, gets past this dependency without
incident.

Later branches in this project (e.g. `wp/6.4`, `wp/6.5`) don't have this
gap because their real upstream history had already added an equivalent
`actions/setup-node` step to `bundle-size.yml` by the time those
branches were cut -- confirmed directly against `WordPress/gutenberg`'s
real `wp/6.4` branch. `wp/5.5` predates that upstream change, so it
never inherited the step and needs it added here instead.

Fixed by adding the same `Setup Node.js` / `actions/setup-node` (pinned
to the same SHA already used everywhere else on this branch) /
`node-version-file: '.nvmrc'` step already used by every other job in
this branch's workflows, placed before the `compressed-size-action` step
so its own internal `npm ci` runs under this branch's real Node.js
version instead of the runner's floating default.
@desrosj
desrosj force-pushed the fix-actions-5.5/update-php-test-matrix branch from 8b9d4df to bd6734a Compare September 14, 2026 09:55
desrosj added a commit that referenced this pull request Sep 14, 2026
`bundle-size.yml`'s `Check` job never had a Node.js version pin of any
kind (confirmed against the real upstream `wp/5.5` history -- this gap
predates this project's stack entirely, unlike every other workflow file
on this branch, which the `single-node-version-testing` layer (#166)
already pinned via `actions/setup-node`'s `node-version-file: '.nvmrc'`).

`preactjs/compressed-size-action` runs its own internal `npm ci` for
both the PR's head and base commits, using whatever Node.js version the
runner defaults to when no `actions/setup-node` step precedes it. On the
current `ubuntu-24.04` runner image that default has drifted to Node.js
22.x, which is incompatible with several of this era's git-dependency
`prepare` scripts -- confirmed via a real CI run on PR #338
(https://github.com/desrosj/gutenberg/actions/runs/34736948068/job/103669957891):
`react-native-svg@9.13.6-gb`'s `bob build` (via `flowgen`/Babel) throws
`SyntaxError: ... Missing initializer in const declaration` parsing a
type-only `export const` in `src/index.d.ts`, a construct npm's bundled
tooling under Node 22 chokes on but which is a non-issue under this
branch's own pinned Node.js version. Every other job on this same PR
(`JavaScript`, `PHP`, `Admin - 1..4`), which already set up Node via
`.nvmrc` before running `npm ci`, gets past this dependency without
incident.

Later branches in this project (e.g. `wp/6.4`, `wp/6.5`) don't have this
gap because their real upstream history had already added an equivalent
`actions/setup-node` step to `bundle-size.yml` by the time those
branches were cut -- confirmed directly against `WordPress/gutenberg`'s
real `wp/6.4` branch. `wp/5.5` predates that upstream change, so it
never inherited the step and needs it added here instead.

Fixed by adding the same `Setup Node.js` / `actions/setup-node` (pinned
to the same SHA already used everywhere else on this branch) /
`node-version-file: '.nvmrc'` step already used by every other job in
this branch's workflows, placed before the `compressed-size-action` step
so its own internal `npm ci` runs under this branch's real Node.js
version instead of the runner's floating default.
@desrosj
desrosj removed this pull request from stack #167 September 21, 2026 17:57
@desrosj
desrosj changed the base branch from fix-actions-5.5/docker-compose-v2 to wp/5.5 September 21, 2026 17:57
@desrosj
desrosj force-pushed the fix-actions-5.5/update-php-test-matrix branch from bd6734a to 4bb87b5 Compare September 21, 2026 17:58
desrosj added a commit that referenced this pull request Sep 21, 2026
`bundle-size.yml`'s `Check` job never had a Node.js version pin of any
kind (confirmed against the real upstream `wp/5.5` history -- this gap
predates this project's stack entirely, unlike every other workflow file
on this branch, which the `single-node-version-testing` layer (#166)
already pinned via `actions/setup-node`'s `node-version-file: '.nvmrc'`).

`preactjs/compressed-size-action` runs its own internal `npm ci` for
both the PR's head and base commits, using whatever Node.js version the
runner defaults to when no `actions/setup-node` step precedes it. On the
current `ubuntu-24.04` runner image that default has drifted to Node.js
22.x, which is incompatible with several of this era's git-dependency
`prepare` scripts -- confirmed via a real CI run on PR #338
(https://github.com/desrosj/gutenberg/actions/runs/34736948068/job/103669957891):
`react-native-svg@9.13.6-gb`'s `bob build` (via `flowgen`/Babel) throws
`SyntaxError: ... Missing initializer in const declaration` parsing a
type-only `export const` in `src/index.d.ts`, a construct npm's bundled
tooling under Node 22 chokes on but which is a non-issue under this
branch's own pinned Node.js version. Every other job on this same PR
(`JavaScript`, `PHP`, `Admin - 1..4`), which already set up Node via
`.nvmrc` before running `npm ci`, gets past this dependency without
incident.

Later branches in this project (e.g. `wp/6.4`, `wp/6.5`) don't have this
gap because their real upstream history had already added an equivalent
`actions/setup-node` step to `bundle-size.yml` by the time those
branches were cut -- confirmed directly against `WordPress/gutenberg`'s
real `wp/6.4` branch. `wp/5.5` predates that upstream change, so it
never inherited the step and needs it added here instead.

Fixed by adding the same `Setup Node.js` / `actions/setup-node` (pinned
to the same SHA already used everywhere else on this branch) /
`node-version-file: '.nvmrc'` step already used by every other job in
this branch's workflows, placed before the `compressed-size-action` step
so its own internal `npm ci` runs under this branch's real Node.js
version instead of the runner's floating default.
@desrosj
desrosj changed the base branch from wp/5.5 to fix-actions-5.5/docker-compose-v2 September 21, 2026 18:00
@desrosj
desrosj added this pull request to stack #400 September 21, 2026 18:00
@desrosj
desrosj removed this pull request from stack #400 September 22, 2026 16:21
@desrosj
desrosj changed the base branch from fix-actions-5.5/docker-compose-v2 to wp/5.5 September 22, 2026 16:21
@desrosj
desrosj force-pushed the fix-actions-5.5/update-php-test-matrix branch from 4bb87b5 to 803b8da Compare September 22, 2026 16:24
desrosj added a commit that referenced this pull request Sep 22, 2026
`bundle-size.yml`'s `Check` job never had a Node.js version pin of any
kind (confirmed against the real upstream `wp/5.5` history -- this gap
predates this project's stack entirely, unlike every other workflow file
on this branch, which the `single-node-version-testing` layer (#166)
already pinned via `actions/setup-node`'s `node-version-file: '.nvmrc'`).

`preactjs/compressed-size-action` runs its own internal `npm ci` for
both the PR's head and base commits, using whatever Node.js version the
runner defaults to when no `actions/setup-node` step precedes it. On the
current `ubuntu-24.04` runner image that default has drifted to Node.js
22.x, which is incompatible with several of this era's git-dependency
`prepare` scripts -- confirmed via a real CI run on PR #338
(https://github.com/desrosj/gutenberg/actions/runs/34736948068/job/103669957891):
`react-native-svg@9.13.6-gb`'s `bob build` (via `flowgen`/Babel) throws
`SyntaxError: ... Missing initializer in const declaration` parsing a
type-only `export const` in `src/index.d.ts`, a construct npm's bundled
tooling under Node 22 chokes on but which is a non-issue under this
branch's own pinned Node.js version. Every other job on this same PR
(`JavaScript`, `PHP`, `Admin - 1..4`), which already set up Node via
`.nvmrc` before running `npm ci`, gets past this dependency without
incident.

Later branches in this project (e.g. `wp/6.4`, `wp/6.5`) don't have this
gap because their real upstream history had already added an equivalent
`actions/setup-node` step to `bundle-size.yml` by the time those
branches were cut -- confirmed directly against `WordPress/gutenberg`'s
real `wp/6.4` branch. `wp/5.5` predates that upstream change, so it
never inherited the step and needs it added here instead.

Fixed by adding the same `Setup Node.js` / `actions/setup-node` (pinned
to the same SHA already used everywhere else on this branch) /
`node-version-file: '.nvmrc'` step already used by every other job in
this branch's workflows, placed before the `compressed-size-action` step
so its own internal `npm ci` runs under this branch's real Node.js
version instead of the runner's floating default.
@desrosj
desrosj changed the base branch from wp/5.5 to fix-actions-5.5/docker-compose-v2 September 22, 2026 16:24
@desrosj
desrosj added this pull request to stack #467 September 22, 2026 16:24
@desrosj
desrosj removed this pull request from stack #467 September 23, 2026 21:31
@desrosj
desrosj changed the base branch from fix-actions-5.5/docker-compose-v2 to wp/5.5 September 23, 2026 21:32
@desrosj
desrosj force-pushed the fix-actions-5.5/update-php-test-matrix branch from 803b8da to bead49d Compare September 23, 2026 21:32
@desrosj
desrosj changed the base branch from fix-actions-5.5/docker-compose-v2 to wp/5.5 September 28, 2026 17:22
desrosj added a commit that referenced this pull request Sep 28, 2026
`bundle-size.yml`'s `Check` job never had a Node.js version pin of any
kind (confirmed against the real upstream `wp/5.5` history -- this gap
predates this project's stack entirely, unlike every other workflow file
on this branch, which the `single-node-version-testing` layer (#166)
already pinned via `actions/setup-node`'s `node-version-file: '.nvmrc'`).

`preactjs/compressed-size-action` runs its own internal `npm ci` for
both the PR's head and base commits, using whatever Node.js version the
runner defaults to when no `actions/setup-node` step precedes it. On the
current `ubuntu-24.04` runner image that default has drifted to Node.js
22.x, which is incompatible with several of this era's git-dependency
`prepare` scripts -- confirmed via a real CI run on PR #338
(https://github.com/desrosj/gutenberg/actions/runs/34736948068/job/103669957891):
`react-native-svg@9.13.6-gb`'s `bob build` (via `flowgen`/Babel) throws
`SyntaxError: ... Missing initializer in const declaration` parsing a
type-only `export const` in `src/index.d.ts`, a construct npm's bundled
tooling under Node 22 chokes on but which is a non-issue under this
branch's own pinned Node.js version. Every other job on this same PR
(`JavaScript`, `PHP`, `Admin - 1..4`), which already set up Node via
`.nvmrc` before running `npm ci`, gets past this dependency without
incident.

Later branches in this project (e.g. `wp/6.4`, `wp/6.5`) don't have this
gap because their real upstream history had already added an equivalent
`actions/setup-node` step to `bundle-size.yml` by the time those
branches were cut -- confirmed directly against `WordPress/gutenberg`'s
real `wp/6.4` branch. `wp/5.5` predates that upstream change, so it
never inherited the step and needs it added here instead.

Fixed by adding the same `Setup Node.js` / `actions/setup-node` (pinned
to the same SHA already used everywhere else on this branch) /
`node-version-file: '.nvmrc'` step already used by every other job in
this branch's workflows, placed before the `compressed-size-action` step
so its own internal `npm ci` runs under this branch's real Node.js
version instead of the runner's floating default.
@desrosj
desrosj force-pushed the fix-actions-5.5/update-php-test-matrix branch from 9c5630f to 54564bb Compare September 28, 2026 17:22
@desrosj
desrosj changed the base branch from wp/5.5 to fix-actions-5.5/docker-compose-v2 September 28, 2026 17:23
@desrosj
desrosj added this pull request to stack #558 September 28, 2026 17:23
@desrosj
desrosj removed this pull request from stack #558 October 6, 2026 16:14
@desrosj
desrosj added this pull request to stack #632 October 6, 2026 16:15
@desrosj
desrosj force-pushed the fix-actions-5.5/update-php-test-matrix branch from 54564bb to a0b4733 Compare October 8, 2026 18:08
desrosj added a commit that referenced this pull request Oct 8, 2026
`bundle-size.yml`'s `Check` job never had a Node.js version pin of any
kind (confirmed against the real upstream `wp/5.5` history -- this gap
predates this project's stack entirely, unlike every other workflow file
on this branch, which the `single-node-version-testing` layer (#166)
already pinned via `actions/setup-node`'s `node-version-file: '.nvmrc'`).

`preactjs/compressed-size-action` runs its own internal `npm ci` for
both the PR's head and base commits, using whatever Node.js version the
runner defaults to when no `actions/setup-node` step precedes it. On the
current `ubuntu-24.04` runner image that default has drifted to Node.js
22.x, which is incompatible with several of this era's git-dependency
`prepare` scripts -- confirmed via a real CI run on PR #338
(https://github.com/desrosj/gutenberg/actions/runs/34736948068/job/103669957891):
`react-native-svg@9.13.6-gb`'s `bob build` (via `flowgen`/Babel) throws
`SyntaxError: ... Missing initializer in const declaration` parsing a
type-only `export const` in `src/index.d.ts`, a construct npm's bundled
tooling under Node 22 chokes on but which is a non-issue under this
branch's own pinned Node.js version. Every other job on this same PR
(`JavaScript`, `PHP`, `Admin - 1..4`), which already set up Node via
`.nvmrc` before running `npm ci`, gets past this dependency without
incident.

Later branches in this project (e.g. `wp/6.4`, `wp/6.5`) don't have this
gap because their real upstream history had already added an equivalent
`actions/setup-node` step to `bundle-size.yml` by the time those
branches were cut -- confirmed directly against `WordPress/gutenberg`'s
real `wp/6.4` branch. `wp/5.5` predates that upstream change, so it
never inherited the step and needs it added here instead.

Fixed by adding the same `Setup Node.js` / `actions/setup-node` (pinned
to the same SHA already used everywhere else on this branch) /
`node-version-file: '.nvmrc'` step already used by every other job in
this branch's workflows, placed before the `compressed-size-action` step
so its own internal `npm ci` runs under this branch's real Node.js
version instead of the runner's floating default.
@desrosj
desrosj removed this pull request from stack #632 October 8, 2026 18:10
@desrosj
desrosj force-pushed the fix-actions-5.5/update-php-test-matrix branch from a0b4733 to 4058b16 Compare October 8, 2026 18:11
@desrosj
desrosj changed the base branch from fix-actions-5.5/docker-compose-v2 to fix-actions-5.5/fix-puppeteer-alias-lockfile-drift October 8, 2026 18:11
@desrosj
desrosj added this pull request to stack #692 October 8, 2026 18:11
@desrosj
desrosj removed this pull request from stack #692 October 9, 2026 19:59
@desrosj
desrosj changed the base branch from fix-actions-5.5/fix-puppeteer-alias-lockfile-drift to wp/5.5 October 9, 2026 20:00
@desrosj
desrosj force-pushed the fix-actions-5.5/update-php-test-matrix branch from 4058b16 to b0657f5 Compare October 9, 2026 20:01
@desrosj
desrosj changed the base branch from wp/5.5 to fix-actions-5.5/fix-puppeteer-alias-lockfile-drift October 9, 2026 20:02
@desrosj
desrosj added this pull request to stack #723 October 9, 2026 20:02
@desrosj
desrosj marked this pull request as ready for review October 16, 2026 17:13
@github-actions

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: desrosj <desrosj@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@desrosj
desrosj removed this pull request from stack #723 October 16, 2026 17:36
@desrosj
desrosj added this pull request to stack #739 October 16, 2026 17:36
`unit-test.yml`'s `unit-php` job has always run a single, versionless
PHPUnit leg: whatever PHP the bare, floating `wordpress`/`wordpress:cli`
Docker images resolve to. This adds `strategy.matrix.php: ['5.6', '7.0',
'7.4']` plus a `multisite` axis (splitting the previously-sequential
`npm run test-php && npm run test-unit-php-multisite` into two isolated
legs, matching how the job already ran both, just no longer forcing a
single-site failure to cancel the multisite run in the same job), with
`fail-fast: false` so a failure on one PHP version's leg doesn't cancel
the runs still verifying the others.

This branch's `@wordpress/env` (v1.6.0) predates the `WP_ENV_PHP_VERSION`
mechanism used to select a PHP version on later branches -- it does not
exist anywhere in `packages/env`'s source, and the `wordpress`/
`wordpress:cli`/`tests-wordpress`/`tests-cli` Docker images in
`build-docker-compose-config.js` are hardcoded, unversioned image
references with no PHP-version templating at all. Setting that variable
here would have had no effect. The one part of this branch's Docker
Compose config that genuinely is PHP-version-selectable is the standalone
`phpunit` service, whose image is
`wordpressdevelop/phpunit:${LOCAL_PHP-latest}` -- a raw docker-compose
environment-variable substitution, not a wp-env config option. Both
`test-php` and `test-unit-php-multisite` execute PHPUnit via `wp-env run
phpunit`, which shells out to `docker compose run` with no explicit `env`
override, so it inherits `LOCAL_PHP` from the job environment. Setting
`LOCAL_PHP: ${{ matrix.php }}-fpm` per leg is what actually pins the PHP
version PHPUnit itself runs under.

`Install WordPress`'s `wp core install`/plugin-activation steps still run
via the `wordpress`/`cli` containers, which stay on Docker Hub's floating
default PHP regardless of this matrix -- that is unaffected by, and
unrelated to, the PHP version PHPUnit itself executes under.

No incompatible dev dependency needed removing for the lower PHP
versions: `spatie/phpunit-watcher` (the package other branches needed to
conditionally drop below PHP 7.2) does not exist in this branch's
`composer.json` at all.
@desrosj
desrosj force-pushed the fix-actions-5.5/update-php-test-matrix branch from b0657f5 to 2f7cf10 Compare October 16, 2026 17:46
desrosj added a commit that referenced this pull request Oct 16, 2026
`bundle-size.yml`'s `Check` job never had a Node.js version pin of any
kind (confirmed against the real upstream `wp/5.5` history -- this gap
predates this project's stack entirely, unlike every other workflow file
on this branch, which the `single-node-version-testing` layer (#166)
already pinned via `actions/setup-node`'s `node-version-file: '.nvmrc'`).

`preactjs/compressed-size-action` runs its own internal `npm ci` for
both the PR's head and base commits, using whatever Node.js version the
runner defaults to when no `actions/setup-node` step precedes it. On the
current `ubuntu-24.04` runner image that default has drifted to Node.js
22.x, which is incompatible with several of this era's git-dependency
`prepare` scripts -- confirmed via a real CI run on PR #338
(https://github.com/desrosj/gutenberg/actions/runs/34736948068/job/103669957891):
`react-native-svg@9.13.6-gb`'s `bob build` (via `flowgen`/Babel) throws
`SyntaxError: ... Missing initializer in const declaration` parsing a
type-only `export const` in `src/index.d.ts`, a construct npm's bundled
tooling under Node 22 chokes on but which is a non-issue under this
branch's own pinned Node.js version. Every other job on this same PR
(`JavaScript`, `PHP`, `Admin - 1..4`), which already set up Node via
`.nvmrc` before running `npm ci`, gets past this dependency without
incident.

Later branches in this project (e.g. `wp/6.4`, `wp/6.5`) don't have this
gap because their real upstream history had already added an equivalent
`actions/setup-node` step to `bundle-size.yml` by the time those
branches were cut -- confirmed directly against `WordPress/gutenberg`'s
real `wp/6.4` branch. `wp/5.5` predates that upstream change, so it
never inherited the step and needs it added here instead.

Fixed by adding the same `Setup Node.js` / `actions/setup-node` (pinned
to the same SHA already used everywhere else on this branch) /
`node-version-file: '.nvmrc'` step already used by every other job in
this branch's workflows, placed before the `compressed-size-action` step
so its own internal `npm ci` runs under this branch's real Node.js
version instead of the runner's floating default.
@desrosj

desrosj commented Oct 16, 2026

Copy link
Copy Markdown
Owner Author

Moved to WordPress#85002.

@desrosj desrosj closed this Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant