Skip to content

chore(ci): migrate workflows to pnpm/setup#11589

Merged
zkochan merged 8 commits into
mainfrom
test-pnpm-setup
May 12, 2026
Merged

chore(ci): migrate workflows to pnpm/setup#11589
zkochan merged 8 commits into
mainfrom
test-pnpm-setup

Conversation

@zkochan
Copy link
Copy Markdown
Member

@zkochan zkochan commented May 11, 2026

Summary

Migrates CI workflows from pnpm/action-setup + manual pn runtime set node … + pn install to the new combined pnpm/setup action (see pnpm/setup#1).

pnpm/setup installs pnpm and the JS runtime in one step. It also runs pnpm install automatically when a package.json is present, so per-workflow install steps are dropped. When the runtime input is set, the action passes --no-runtime to pnpm install so the matrix-selected Node version isn't shadowed by a different devEngines.runtime pin.

What changed

Workflow Migration
test.yml pnpm/setup with runtime: node@${{ inputs.node }}. Verify-Node step asserts the matrix version stayed active. Verify-npm step retained as canary (npm comes from the runner image, not the pnpm-installed runtime).
ci.yml pnpm/setup (no runtime input — devEngines.runtime in package.json handles the Node pin).
release.yml pnpm/setup with runtime: node@26.0.0.
benchmark.yml pnpm/setup with runtime: node@26.0.0.
audit.yml pnpm/setup with install: false — audit only needs pnpm itself, not node_modules.
update-lockfile.yml pnpm/setup with install: false — the job deletes pnpm-lock.yaml and regenerates it via --lockfile-only, so the action's auto-install would be wasted.
update-latest.yml Untouched — it only uses npm, no pnpm setup needed.

Caveats / things to watch

  • npm availability. pnpm runtime set node does not extract npm. The runner image's pre-installed Node toolchain provides npm on PATH; if a future runner image change removes that, dlx-style git-hosted dependency tests in test.yml will fail. The Verify npm step in test.yml is the canary.

Related upstream change

  • pnpm/setup#3 — added the install input so callers like audit.yml and update-lockfile.yml can opt out of the action's auto-install.

Test plan

  • CI workflow (ci.yml) passes — compile + lint with pnpm/setup
  • test.yml matrix passes across node versions and platforms
  • audit.yml passes
  • Manual trigger of benchmark.yml (workflow_dispatch) — optional, only if the perf path needs verifying

Summary by CodeRabbit

  • Chores
    • Updated GitHub Actions workflow configurations to standardize pnpm installation tooling across audit, benchmark, continuous integration, release, test, and lockfile update jobs. These infrastructure refinements ensure consistent build environment setup.

Review Change Stack


PR description updated by an agent (Claude Code, claude-opus-4-7).

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 11, 2026

📝 Walkthrough

Walkthrough

Five GitHub Actions workflow files are updated to use the pnpm/setup action in place of the older pnpm/action-setup action. Configuration is consolidated to specify Node runtime versions directly in the setup action, and intermediate setup steps are removed where they are no longer needed.

Changes

GitHub Actions pnpm setup action migration

Layer / File(s) Summary
Setup action with install control
.github/workflows/audit.yml, .github/workflows/update-lockfile.yml
Audit and update-lockfile workflows migrate to pnpm/setup with install: false, preserving their skip-install behavior during action execution.
Setup action with explicit Node version configuration
.github/workflows/ci.yml, .github/workflows/benchmark.yml, .github/workflows/release.yml, .github/workflows/test.yml
CI, benchmark, release, and test workflows migrate to pnpm/setup and configure explicit Node versions (node@26.0.0 or parameterized inputs); intermediate pnpm runtime set node and standalone pnpm install steps are consolidated into the action configuration.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • pnpm/pnpm#11553: Both PRs modify the repository's GitHub Actions pnpm setup steps in the same workflow files to upgrade action usage.
  • pnpm/pnpm#11472: Both PRs update the same GitHub Actions workflow steps across benchmark.yml, ci.yml, and release.yml.

Poem

🐰 A speedy upgrade hops in place,
Old actions vanish, no trace,
With pnpm/setup shining bright,
Workflows dance, and runtimes align—
All workflows now unified and fine!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title 'chore(ci): migrate workflows to pnpm/setup' accurately summarizes the main change across all modified files—migrating from pnpm/action-setup to pnpm/setup in multiple GitHub Actions workflows.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test-pnpm-setup

Comment @coderabbitai help to get the list of available commands and usage tips.

zkochan added a commit to pnpm/setup that referenced this pull request May 11, 2026
On Windows, `pnpm self-update` lands the new pnpm into PNPM_HOME/bin
as either `.exe`, `.cmd`, or extensionless `pnpm` depending on version
and shim mechanism. Hardcoding `pnpm.exe` and spawning under shell:true
caused cmd.exe to report "not recognized" when the extension didn't
match. Drop the extension and let PATHEXT resolve.

Also bump the test workflow's pnpm version from 11.0.4 (which matches
the bootstrap, making self-update a no-op) to 11.0.7, so the
self-update + runtime install path is actually exercised in CI on
every OS.

Caught by the pnpm/pnpm migration in pnpm/pnpm#11589.
zkochan added a commit to pnpm/setup that referenced this pull request May 11, 2026
## Summary

When the user pins a runtime via the action's `runtime` input, that runtime has already been installed and put on `PATH` by the time the action's auto-`pnpm install` runs. If the project's `package.json` also declares a different `devEngines.runtime` with `onFail: download`, pnpm install would fetch that second runtime and silently swap the active one — defeating matrix-style or explicit pins.

This PR appends `--no-runtime` to the auto-`pnpm install` invocation whenever the `runtime` input is set. The flag (pnpm ≥ 11.1.0) tells pnpm install to skip the runtime fetch entirely. The lockfile and frozen-install behavior are untouched.

When `runtime` is omitted (and the action read it from `devEngines.runtime` instead), `pnpm install` runs unmodified — the devEngines runtime is the only source of truth and install should honor it.

## What changed

- `src/pnpm-install/index.ts` — append `--no-runtime` to the install args when `inputs.runtime` is defined.
- `.github/workflows/test.yaml` — bump pnpm pin to `11.1.0` everywhere (required for `--no-runtime`). Add a new `runtime-overrides-devengines` job that pins `node@22` in the action input, declares `^20.0.0` in `devEngines.runtime`, and asserts node 22 is still active after install.
- `README.md` — documents the new auto-flag behavior and the pnpm ≥ 11.1.0 requirement under "How it works".

## Why this is opt-in by input, not by config

The two interesting cases:

| `runtime` input | `devEngines.runtime` | Behavior |
|---|---|---|
| set | set, different | **--no-runtime** — explicit input wins, install doesn't shadow |
| set | unset | --no-runtime — harmless no-op |
| unset | set | normal install — devEngines.runtime is the only source |
| unset | unset | normal install — no runtime to worry about |

The "set + different" case is the only one that previously misbehaved.

## Test plan

- [ ] All matrix jobs in `Test Action` pass, including the new `runtime-overrides-devengines` job
- [ ] `pr-check / check-dist` passes
- [ ] After merge, follow up on `pnpm/pnpm#11589` to drop the manual `env: npm_config_runtime: 'false'` workaround

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

## Release Notes

* **New Features**
  * Enhanced runtime configuration support during dependency installation to prevent conflicts with existing configurations.

* **Documentation**
  * Updated guidance on pnpm version compatibility requirements and installation behavior when providing runtime inputs.

* **Tests**
  * Expanded test coverage for runtime configuration override scenarios.

* **Chores**
  * Updated pnpm to version 11.1.0.

[![Review Change Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/pnpm/setup/pull/2)

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
zkochan added 4 commits May 12, 2026 14:49
pnpm/setup installs pnpm and the JS runtime in one step, replacing the
separate `pnpm/action-setup` + `pn runtime -g set node …` + `pn install`
trio. `pnpm install` now happens inside the action, so the per-workflow
install step is gone.

- test.yml: replaced with `pnpm/setup` (runtime: node@<inputs.node>);
  Verify-npm step retained as a sanity check (npm comes from the runner
  image, not the pnpm-installed runtime).
- ci.yml, release.yml, benchmark.yml: same migration with pinned node
  versions.
- audit.yml: only needs pnpm, no runtime input.
- update-lockfile.yml: migrated with a note flagging that the action's
  auto-install is wasted work for this job (it then deletes the lockfile
  and regenerates with --lockfile-only).
- update-latest.yml: untouched — it doesn't use pnpm.

This commit pins to the `init-action` branch of pnpm/setup. Pin to a SHA
or tag before merging.
The init-action branch was deleted after pnpm/setup#1 was merged.
v0 is the moving major-zero ref published from pnpm/setup; v0.0.1 is
the immutable tag it currently points at.
Picks up the fix from pnpm/setup#2:
- Drops the buggy patchPnpmEnv that shadowed the self-updated pnpm on
  Windows-standalone.
- Auto-appends --no-runtime to pnpm install when a runtime input is set
  and the running pnpm is >= 11.1.0.

The manual `env: npm_config_runtime: 'false'` workaround in test.yml is
no longer needed — the action handles it.
@zkochan zkochan force-pushed the test-pnpm-setup branch from b05472c to c209446 Compare May 12, 2026 13:01
zkochan added a commit to pnpm/setup that referenced this pull request May 12, 2026
Other setup actions (actions/setup-node, setup-python, oven-sh/setup-bun,
denoland/setup-deno) install the toolchain only and leave dependency
installation to the caller. Match that convention instead of providing
an opt-out for cases like `pnpm audit` or lockfile-only regeneration
jobs (see pnpm/pnpm#11589) that don't want the install.
zkochan added a commit to pnpm/setup that referenced this pull request May 12, 2026
* feat: do not run pnpm install automatically

Other setup actions (actions/setup-node, setup-python, oven-sh/setup-bun,
denoland/setup-deno) install the toolchain only and leave dependency
installation to the caller. Match that convention instead of providing
an opt-out for cases like `pnpm audit` or lockfile-only regeneration
jobs (see pnpm/pnpm#11589) that don't want the install.

* test: add explicit pnpm install steps in tests

Two test jobs (`runtime-from-devengines` and `runtime-overrides-devengines`)
asserted that the action runs `pnpm install` automatically. Now that the
action no longer does that, add the install as an explicit caller step
and update comments. For the override case, pass `--no-runtime` since the
caller — not the action — owns suppressing the devEngines runtime fetch.
zkochan added 4 commits May 12, 2026 18:26
pnpm/setup no longer auto-runs `pnpm install`, so add explicit
`pn install` steps in the workflows that need node_modules.
`devEngines.runtime` in package.json already pins node@24.6.0 with
`onFail: download`, so pnpm will fetch the same version on first use.
Re-add the post-install Node version check that asserts the matrix
`inputs.node` survives `pn install`. Pass `--no-runtime` so devEngines
runtime (24.6.0, onFail: download) doesn't swap the matrix-installed
Node out from under the canary.
pnpm/setup now runs `pnpm install` by default again (with auto
`--no-runtime` when `runtime:` is set), so the explicit install
steps are no longer needed. Set `install: false` in jobs that
don't want the install — audit and lockfile-only regeneration.
@zkochan zkochan marked this pull request as ready for review May 12, 2026 17:26
Copilot AI review requested due to automatic review settings May 12, 2026 17:26
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Migrates GitHub Actions workflows from pnpm/action-setup plus manual pnpm runtime set node … / pnpm install steps to the new consolidated pnpm/setup action, relying on its built-in runtime installation and auto-install behavior to simplify CI.

Changes:

  • Replace pnpm/action-setup with pnpm/setup across CI-related workflows.
  • Remove explicit pnpm install steps where pnpm/setup will auto-install.
  • Configure pnpm/setup with runtime: node@… in workflows that need a pinned Node version, and disable auto-install where it’s intentionally redundant.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
.github/workflows/update-lockfile.yml Switches to pnpm/setup and disables auto-install during lockfile regeneration.
.github/workflows/test.yml Uses pnpm/setup to install pnpm + a specified Node runtime; relies on action auto-install and keeps an npm canary check.
.github/workflows/release.yml Uses pnpm/setup to install pnpm + Node runtime and removes explicit install steps.
.github/workflows/ci.yml Switches to pnpm/setup and relies on auto-install instead of an explicit install step.
.github/workflows/benchmark.yml Uses pnpm/setup to install pnpm + Node runtime and removes explicit dependency install step.
.github/workflows/audit.yml Switches to pnpm/setup while disabling auto-install for an audit-only job.

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

Comment thread .github/workflows/update-lockfile.yml
@zkochan zkochan merged commit dcc171a into main May 12, 2026
17 checks passed
@zkochan zkochan deleted the test-pnpm-setup branch May 12, 2026 17:31
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