Skip to content

Commit f4f7afc

Browse files
kraenhansenclaude
andauthored
ci: set Node.js up before pnpm and move to pnpm/action-setup v6 (#407)
* ci: set Node.js up before pnpm and move to pnpm/action-setup v6 #405 held pnpm/action-setup at v5 because v6 bootstraps pnpm by shelling out to `npm ci`, and the self-hosted Linux runner's only npm is the broken copy in the runner's own Node.js 24 externals: Error: Cannot find module '../lib/cli.js' v6 resolves npm through PATH and merely appends that externals directory, so running actions/setup-node first — which prepends its own Node.js installation — puts a working npm ahead of it. The reason pnpm came first was setup-node's `cache: pnpm`, which shells out to `pnpm store path` and so needs pnpm to already exist. v6 caches the pnpm store itself, keyed on the lockfile, so that input moves from setup-node to `cache: true` on pnpm/action-setup and the ordering constraint disappears. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01W14eEfXdK5DYzv43MazryE * ci: re-run checks for the newly applied labels check.yml only runs on opened/synchronize/reopened, so the label-gated jobs — including the self-hosted Android one this change needs to prove itself on — do not start from labelling alone. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01W14eEfXdK5DYzv43MazryE --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent fbfb44c commit f4f7afc

2 files changed

Lines changed: 43 additions & 33 deletions

File tree

‎.github/workflows/check.yml‎

Lines changed: 32 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -25,30 +25,31 @@ concurrency:
2525
group: ${{ github.workflow }}-${{ github.ref }}
2626
cancel-in-progress: true
2727

28-
# Two actions below are deliberately held back from their newest release, both
29-
# because of the Node.js 20 deprecation:
28+
# Every job sets Node.js up before pnpm, which is the opposite of what pnpm's
29+
# own docs suggest. pnpm/action-setup v6 bootstraps pnpm by shelling out to
30+
# `npm ci`, and it finds npm on PATH — on our self-hosted Linux runner the only
31+
# npm there is the broken copy in the runner's own Node.js 24 externals, so the
32+
# setup step dies with "Cannot find module '../lib/cli.js'". Running setup-node
33+
# first puts a working npm ahead of it. The usual ordering exists so that
34+
# setup-node's `cache: pnpm` can shell out to `pnpm store path`; pnpm's own
35+
# `cache: true` caches the same store without needing pnpm to already exist.
3036
#
31-
# - pnpm/action-setup is pinned to v5, not v6. v6 rewrote the self-installer to
32-
# shell out to `npm ci`, and our self-hosted Linux runner has no npm on PATH
33-
# beyond the runner's own Node.js 24 externals — where it is broken. v5 is a
34-
# Node.js 24 action too, and still bootstraps from a bundled pnpm, so it
35-
# clears the deprecation without the new npm dependency. Move to v6 once that
36-
# runner has a working npm.
37-
# - hendrikmuhs/ccache-action is pinned to an exact patch because its floating
38-
# v1 / v1.2 tags still point at a Node.js 20 build. Float again once upstream
39-
# moves them to >= v1.2.22.
37+
# hendrikmuhs/ccache-action is pinned to an exact patch, not a floating major:
38+
# its v1 / v1.2 tags still point at a Node.js 20 build, which the runners now
39+
# warn about. Float again once upstream moves them to >= v1.2.22.
4040

4141
jobs:
4242
lint:
4343
name: Lint
4444
runs-on: ubuntu-latest
4545
steps:
4646
- uses: actions/checkout@v7
47-
- uses: pnpm/action-setup@v5
4847
- uses: actions/setup-node@v7
4948
with:
5049
node-version: lts/krypton
51-
cache: pnpm
50+
- uses: pnpm/action-setup@v6
51+
with:
52+
cache: true
5253
- name: Setup cpp tools
5354
uses: aminya/setup-cpp@v1
5455
with:
@@ -93,11 +94,12 @@ jobs:
9394
name: Unit tests (${{ matrix.runner }})
9495
steps:
9596
- uses: actions/checkout@v7
96-
- uses: pnpm/action-setup@v5
9797
- uses: actions/setup-node@v7
9898
with:
9999
node-version: lts/krypton
100-
cache: pnpm
100+
- uses: pnpm/action-setup@v6
101+
with:
102+
cache: true
101103
- name: Setup cpp tools
102104
uses: aminya/setup-cpp@v1
103105
with:
@@ -132,11 +134,12 @@ jobs:
132134
name: Weak Node-API tests (${{ matrix.runner }})
133135
steps:
134136
- uses: actions/checkout@v7
135-
- uses: pnpm/action-setup@v5
136137
- uses: actions/setup-node@v7
137138
with:
138139
node-version: lts/krypton
139-
cache: pnpm
140+
- uses: pnpm/action-setup@v6
141+
with:
142+
cache: true
140143
- name: Setup cpp tools
141144
uses: aminya/setup-cpp@v1
142145
with:
@@ -161,11 +164,12 @@ jobs:
161164
runs-on: macos-latest
162165
steps:
163166
- uses: actions/checkout@v7
164-
- uses: pnpm/action-setup@v5
165167
- uses: actions/setup-node@v7
166168
with:
167169
node-version: lts/krypton
168-
cache: pnpm
170+
- uses: pnpm/action-setup@v6
171+
with:
172+
cache: true
169173
- name: Setup cpp tools
170174
uses: aminya/setup-cpp@v1
171175
with:
@@ -205,11 +209,12 @@ jobs:
205209
runs-on: macos-latest
206210
steps:
207211
- uses: actions/checkout@v7
208-
- uses: pnpm/action-setup@v5
209212
- uses: actions/setup-node@v7
210213
with:
211214
node-version: lts/krypton
212-
cache: pnpm
215+
- uses: pnpm/action-setup@v6
216+
with:
217+
cache: true
213218
- name: Setup cpp tools
214219
uses: aminya/setup-cpp@v1
215220
with:
@@ -253,11 +258,12 @@ jobs:
253258
runs-on: ubuntu-self-hosted
254259
steps:
255260
- uses: actions/checkout@v7
256-
- uses: pnpm/action-setup@v5
257261
- uses: actions/setup-node@v7
258262
with:
259263
node-version: lts/krypton
260-
cache: pnpm
264+
- uses: pnpm/action-setup@v6
265+
with:
266+
cache: true
261267
- name: Setup cpp tools
262268
uses: aminya/setup-cpp@v1
263269
with:
@@ -343,11 +349,12 @@ jobs:
343349
runs-on: macos-latest
344350
steps:
345351
- uses: actions/checkout@v7
346-
- uses: pnpm/action-setup@v5
347352
- uses: actions/setup-node@v7
348353
with:
349354
node-version: lts/krypton
350-
cache: pnpm
355+
- uses: pnpm/action-setup@v6
356+
with:
357+
cache: true
351358
- name: Setup cpp tools
352359
uses: aminya/setup-cpp@v1
353360
with:

‎.github/workflows/release.yml‎

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ on:
2020
# refreshing the "Version Packages" pull request until someone approves. The
2121
# two jobs that must not overlap carry their own groups instead.
2222

23-
# pnpm/action-setup is pinned to v5 and hendrikmuhs/ccache-action to an exact
24-
# patch, both for Node.js 20 deprecation reasons. See the note in check.yml.
23+
# Node.js is set up before pnpm, and hendrikmuhs/ccache-action is pinned to an
24+
# exact patch rather than a floating major. See the note in check.yml for why.
2525

2626
jobs:
2727
# changesets/action's sub-actions split the "what should happen?" decision out
@@ -39,11 +39,12 @@ jobs:
3939
mode: ${{ steps.select.outputs.mode }}
4040
steps:
4141
- uses: actions/checkout@v7
42-
- uses: pnpm/action-setup@v5
4342
- uses: actions/setup-node@v7
4443
with:
4544
node-version: lts/krypton
46-
cache: pnpm
45+
- uses: pnpm/action-setup@v6
46+
with:
47+
cache: true
4748
# select-mode runs the locally installed @changesets/cli, so the workspace
4849
# has to be installed before it.
4950
- run: pnpm install
@@ -71,11 +72,12 @@ jobs:
7172
pull-requests: write # the "Version Packages" pull request
7273
steps:
7374
- uses: actions/checkout@v7
74-
- uses: pnpm/action-setup@v5
7575
- uses: actions/setup-node@v7
7676
with:
7777
node-version: lts/krypton
78-
cache: pnpm
78+
- uses: pnpm/action-setup@v6
79+
with:
80+
cache: true
7981
- run: pnpm install
8082

8183
- name: Create Release Pull Request
@@ -98,11 +100,12 @@ jobs:
98100
id-token: write # NPM trusted publishing
99101
steps:
100102
- uses: actions/checkout@v7
101-
- uses: pnpm/action-setup@v5
102103
- uses: actions/setup-node@v7
103104
with:
104105
node-version: lts/krypton
105-
cache: pnpm
106+
- uses: pnpm/action-setup@v6
107+
with:
108+
cache: true
106109
- name: Setup cpp tools
107110
uses: aminya/setup-cpp@v1
108111
with:

0 commit comments

Comments
 (0)