Skip to content

Build/Test Tools: Install the npm version required by package.json in GitHub Actions - #13505

Open
manzoorwanijk wants to merge 5 commits into
WordPress:trunkfrom
manzoorwanijk:update/ci-setup-npm
Open

Build/Test Tools: Install the npm version required by package.json in GitHub Actions#13505
manzoorwanijk wants to merge 5 commits into
WordPress:trunkfrom
manzoorwanijk:update/ci-setup-npm

Conversation

@manzoorwanijk

@manzoorwanijk manzoorwanijk commented Sep 13, 2026

Copy link
Copy Markdown
Member

Adds a setup-npm action, mirroring WordPress/gutenberg#82775 and WordPress/gutenberg#82823, so CI installs the npm required by devEngines.packageManager even when Node.js bundles an older one. It also adds the same devEngines field as Gutenberg to package.json.

It will allow us to use the latest version of npm in CI without the EBADDEVENGINES error.

  • setup-npm owns the npm cache, because actions/setup-node resolves it with the bundled npm, which fails with EBADDEVENGINES once a newer npm is required.
  • Release branches run these reusable workflows from trunk against their own checkout, which lacks the action. A hashFiles gate skips it there.
  • Release branches lose the npm download cache. They run rarely, and setup-node's exact key rarely hit anyway.
  • Callers' paths filters now include .github/actions/setup-npm/**.

cc @desrosj: unrelated, but 6.9's test-build-processes.yml omits gutenberg-branch, so it builds Gutenberg trunk on Node.js 20 and every Gutenberg job fails with EBADENGINE. Passing gutenberg-branch: 'wp/6.9', as 6.5 to 6.8 do, we should fix it.

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

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5
Used for: Implementation and this description, reviewed by me.

🤖 Generated with Claude Code


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

Install the npm version required by `devEngines.packageManager`, keeping the bundled npm when the field is absent. Restore the npm download cache with `actions/cache`, since `actions/setup-node` resolves it with the bundled npm.

Mirrors the Gutenberg action from WordPress/gutenberg#82775 and WordPress/gutenberg#82823.

See #66099.
…ction.

Disable npm caching in `actions/setup-node` and run `setup-npm` before installing dependencies. Skip the action on release branches that run these workflows from `trunk` without it.

Run the calling workflows when the action changes.

See #66099.
Declare the same Node.js and npm requirements as Gutenberg, so CI installs the required npm version.

See #66099.
@manzoorwanijk
manzoorwanijk marked this pull request as ready for review September 13, 2026 13:51
@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 manzoorwanijk.

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

@manzoorwanijk
manzoorwanijk marked this pull request as draft September 13, 2026 13:52
@manzoorwanijk
manzoorwanijk marked this pull request as ready for review September 13, 2026 13:53
@manzoorwanijk

Copy link
Copy Markdown
Member Author

I can't request a review, so CCing you all

@desrosj @lancewillett @aduth @ciampo @jsnajdr @tyxla

@github-actions

Copy link
Copy Markdown

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

@manzoorwanijk
manzoorwanijk marked this pull request as draft September 13, 2026 14:09
@manzoorwanijk
manzoorwanijk marked this pull request as ready for review September 13, 2026 15:54
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.

1 participant