Build/Test Tools: Allow the reusable PHPUnit workflow to test another repository. - #12862
Build/Test Tools: Allow the reusable PHPUnit workflow to test another repository.#12862lucatume wants to merge 2 commits into
Conversation
Trac Ticket MissingThis pull request is missing a link to a Trac ticket. For a contribution to be considered, there must be a corresponding ticket in Trac. To attach a pull request to a Trac ticket, please include the ticket's full URL in your pull request description. More information about contributing to WordPress on GitHub can be found in the Core Handbook. |
|
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 Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
… repository. A reusable workflow checks out the repository that calls it, so a caller that is not wordpress-develop cannot use this workflow and ends up maintaining a copy of it. Add optional `repository` and `ref` inputs so the checkout can point elsewhere, and an `overlay-artifact` input that unpacks a same-run artifact over the checkout, for callers whose test files are not part of the repository being tested. All three default to empty, so existing callers are unaffected: repository falls back to the calling repository, an empty ref is already checkout's own default and the overlay step is skipped.
…ository. The producer checks out the commit that started the calling workflow run, so a caller preparing a build for a branch of another repository always got the wrong one. Add optional `repository` and `ref` inputs, plus an `artifact-name` input for callers that prepare several builds in a single run and would otherwise collide on one artifact name. Retry the download as well. On branches whose download.js predates the in-script retry the blob is streamed straight into tar in a single attempt, so an interrupted stream fails the job outright. All three inputs default to the current behaviour, so existing callers are unaffected.
4a3955e to
5fdbb75
Compare
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.