Opened 4 days ago
Last modified 4 days ago
#65964 new enhancement
Allow the reusable PHPUnit workflow to test another repository
| Reported by: | lucatume | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | Build/Test Tools | Version: | |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: |
Description
A reusable workflow checks out the repository that calls it, so reusable-phpunit-tests-v3.yml can only test a wordpress-develop checkout made by a wordpress-develop workflow run. A repository that wants to run this suite against a wordpress-develop checkout with its own test files layered in has no way to call it, and keeps a copy of the workflow instead. That copy then inherits none of the fixes that land here.
Three optional inputs remove the need for one: repository and ref for the checkout, and overlay-artifact, which unpacks a same-run artifact over the checkout for callers whose test files aren't part of the repository being tested.
All three inputs default to an empty string, so no existing caller changes behaviour. The overlay is downloaded after the checkout and before the Gutenberg build, and reads through the same same-run artifact mechanism as gutenberg-artifact, so it can only reach artifacts from the run that called the workflow.
PR: https://github.com/WordPress/wordpress-develop/pull/12862
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Trac ticket: https://core.trac.wordpress.org/ticket/65964
A reusable workflow checks out the repository that calls it, so
reusable-phpunit-tests-v3.ymlcan only test a wordpress-develop checkout made by a wordpress-develop workflow run. A repository that wants to run this suite against a wordpress-develop checkout with its own test files layered in has no way to call it, and keeps a copy of the workflow instead. That copy then inherits none of the fixes that land here.Three optional inputs remove the need for one:
repositoryandreffor the checkout, andoverlay-artifact, which unpacks a same-run artifact over the checkout for callers whose test files aren't part of the repository being tested.## What to check
All three inputs default to an empty string, so no existing caller changes behaviour:
repository: ${{ inputs.repository || github.repository }}falls back togithub.repository, which isactions/checkout's own default.ref: ''is alreadyactions/checkout's default.if: inputs.overlay-artifact != ''.phpunit-tests.yml,test-coverage.ymland every 5.9+ branch calling this workflow at@trunkpass none of them.The overlay is downloaded after the checkout and before the Gutenberg build, so a caller can't use it to swap out a prepared Gutenberg build. It reads through the same same-run artifact mechanism as
gutenberg-artifact, so it can only reach artifacts from the run that called the workflow.## Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5
Used for: analysing the constraint and proposing the diff; I applied and reviewed the change.