Skip to content

Build/Test Tools: Allow the PHPUnit runner to be set by a repository variable. - #12745

Closed
lancewillett wants to merge 1 commit into
WordPress:trunkfrom
lancewillett:feat/phpunit-runner-variable
Closed

Build/Test Tools: Allow the PHPUnit runner to be set by a repository variable.#12745
lancewillett wants to merge 1 commit into
WordPress:trunkfrom
lancewillett:feat/phpunit-runner-variable

Conversation

@lancewillett

Copy link
Copy Markdown
Contributor

Allows the PHPUnit runner to be directed by a repository variable, defaulting to the current runner.

reusable-phpunit-tests-v3.yml changes its runs-on to ${{ vars.PHPUNIT_RUNNER || inputs.os }}. With the PHPUNIT_RUNNER variable unset (the default), jobs run on inputs.os (ubuntu-24.04) exactly as before. When a maintainer sets PHPUNIT_RUNNER to a runner label, the PHPUnit matrices run on that runner instead—useful for directing them to a dedicated runner during high-load release windows, without editing the workflow.

  • No behavior change by default; the variable is unset.
  • Backward-compatible for every branch that calls this workflow @trunk; no input is added or made required.
  • vars is available in runs-on, so the override is valid.

Trac: https://core.trac.wordpress.org/ticket/65749

Copilot AI review requested due to automatic review settings July 28, 2026 21:37
@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.

Core Committers: Use this line as a base for the props when committing in SVN:

Props lancewillett.

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

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR adds an optional GitHub Actions repository-variable override so maintainers can redirect the reusable PHPUnit workflow’s job runner without editing workflow files, while preserving the existing default behavior.

Changes:

  • Updates the reusable PHPUnit workflow job to prefer vars.PHPUNIT_RUNNER (if set) over the existing inputs.os runner selection.
  • Keeps backward compatibility by falling back to inputs.os when the variable is unset/empty.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@lancewillett

lancewillett commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

For this to work, @bazza or another GitHub admin will need to flip the PHPUNIT_RUNNER variable before / after release using GitHub.com settings for WordPress.org.


How to route the PHPUnit matrices to a specific runner

This change is a no-op until a PHPUNIT_RUNNER repository variable exists. To direct the PHPUnit jobs to a runner (for example, a larger release-runner during a high-load release window):

⚠️ Note to admin: you'd need to do these steps separately per repo, wordpress-develop, wordpress-develop-security, and/or gutenberg (etc.)

Turn it on

  1. Repo → Settings → Secrets and variables → Actions → Variables.
  2. New repository variable → Name: PHPUNIT_RUNNER, Value: the runner label (e.g. release-runner).
  3. New PHPUnit runs pick it up immediately. In-flight runs are unaffected; re-run if you need them moved.

Turn it off

  1. Same page → delete the PHPUNIT_RUNNER variable.
  2. PHPUnit jobs fall back to the default runner (ubuntu-24.04).

Notes

  • Scoped per repository—set it only on the exact repo you want to redirect; other repos are unaffected.
  • Larger hosted runners are billed per-minute, so set it only for the window and remove it after.
  • Changing the variable needs repo admin access.

pento pushed a commit that referenced this pull request Jul 28, 2026
…variable.

Change `runs-on` in the reusable PHPUnit workflow to `${{ vars.PHPUNIT_RUNNER || inputs.os }}`. With the variable unset (the default), jobs run exactly as before.

When a maintainer sets `PHPUNIT_RUNNER` to a runner label, the PHPUnit matrices run on that runner instead—useful for directing them to a dedicated runner during high-load release windows, without editing the workflow.

No input is added or made required, so every branch that calls this workflow at `@trunk` stays compatible.

Developed in: #12745

Props barry.
Fixes #65749.


git-svn-id: https://develop.svn.wordpress.org/trunk@62891 602fd350-edb4-49c9-b593-d223f7449a82
@github-actions

Copy link
Copy Markdown

A commit was made that fixes the Trac ticket referenced in the description of this pull request.

SVN changeset: 62891
GitHub commit: c5690fd

This PR will be closed, but please confirm the accuracy of this and reopen if there is more work to be done.

@github-actions github-actions Bot closed this Jul 28, 2026
markjaquith pushed a commit to markjaquith/WordPress that referenced this pull request Jul 28, 2026
…variable.

Change `runs-on` in the reusable PHPUnit workflow to `${{ vars.PHPUNIT_RUNNER || inputs.os }}`. With the variable unset (the default), jobs run exactly as before.

When a maintainer sets `PHPUNIT_RUNNER` to a runner label, the PHPUnit matrices run on that runner instead—useful for directing them to a dedicated runner during high-load release windows, without editing the workflow.

No input is added or made required, so every branch that calls this workflow at `@trunk` stays compatible.

Developed in: WordPress/wordpress-develop#12745

Props barry.
Fixes #65749.

Built from https://develop.svn.wordpress.org/trunk@62891


git-svn-id: http://core.svn.wordpress.org/trunk@62158 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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.

3 participants