Skip to content

Resolve the WordPress test matrix from wordpress.org at run time - #87

Merged
roborourke merged 2 commits into
mainfrom
dynamic-wp-test-matrix
Sep 22, 2026
Merged

roborourke merged 2 commits into
mainfrom
dynamic-wp-test-matrix

Conversation

@joehoyle

@joehoyle joehoyle commented Sep 22, 2026

Copy link
Copy Markdown
Member

The test matrix is a hardcoded list of WordPress versions, and it had already fallen behind: it stopped at 6.9 while WordPress is on 7.1.1, so two majors were shipping without any CI coverage. That will keep happening every release cycle unless someone remembers to edit the workflow.

Instead, a small first job asks wordpress.org's stable-check API for every release, collapses them to x.y branches, and feeds the newest five into the PHPUnit matrix. Today that resolves to 6.7 through 7.1. When 7.2 ships it appears on the next run and 6.7 drops off, with no PR required. Trunk rides along as nightly across every PHP version and is non-blocking, so it cannot fail the run but gives early warning on the next release. A weekly cron and workflow_dispatch make sure the resolved versions and trunk are exercised even when the repo is quiet.

The install script already understood x.y and nightly inputs, so it is untouched. One trade-off: if the wordpress.org API is unreachable the resolver job fails and no tests run. I preferred a loud failure over a silent fallback to a stale list, but a hardcoded fallback is easy to add if reviewers would rather have it.

🤖 Generated with Claude Code

The hardcoded matrix stopped at 6.9 while WordPress is on 7.1, so two
majors were shipping untested. Fetch the supported x.y branches from the
stable-check API on each run and test the newest five, add a
non-blocking trunk job, and run weekly so new releases get covered
without anyone editing the workflow.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@joehoyle
joehoyle force-pushed the dynamic-wp-test-matrix branch from ba0a1c0 to 565d17f Compare September 22, 2026 13:52
Trunk was a single extra job on one PHP version, which left it with less
coverage than the stable branches. Append it to the resolved list so it
is part of the full grid, and keep it non-blocking by matching on the
version name rather than a separate matrix flag.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

@roborourke roborourke left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Handy pattern there.

@roborourke
roborourke merged commit 2328bb5 into main Sep 22, 2026
44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants