Skip to content

Commit 07c23ef

Browse files
committed
ci: speed up the Windows ARM64 unit test job
Installing dependencies took eight minutes there against one on x64. Neither bufferutil nor utf-8-validate ships a win32-arm64 prebuild, so pnpm compiled both with node-gyp on every cold install. Both fall back to JavaScript when no binary is present, so skip their builds. setup-node's pnpm cache restores on an exact lockfile hash, so a dependency bump refetched the whole store on every runner. Hand the store cache to pnpm/action-setup, which keys on the same hash but falls back to the last store for the platform. A cold setup step now takes 2m31s.
1 parent f164c8f commit 07c23ef

3 files changed

Lines changed: 10 additions & 4 deletions

File tree

‎.github/actions/setup/action.yml‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,15 @@ runs:
1010
run: git config --global url."https://github.com/".insteadOf "git@github.com:"
1111

1212
- uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
13+
with:
14+
# Caches the pnpm store, keyed by lockfile hash with a prefix fallback,
15+
# so a dependency bump reuses the rest of the store. setup-node's own
16+
# pnpm cache restores on an exact hash only.
17+
cache: true
1318

1419
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
1520
with:
1621
node-version: "22"
17-
cache: "pnpm"
1822

1923
- name: Install dependencies
2024
shell: bash

‎CONTRIBUTING.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,8 @@ When updating the minimum Node.js version, update these files:
324324

325325
Some dependencies are not directly used in the source but are required anyway.
326326

327-
- `bufferutil` and `utf-8-validate` are peer dependencies of `ws`.
327+
- `bufferutil` and `utf-8-validate` are peer dependencies of `ws`. Their source
328+
builds are off, so Windows on ARM64 uses their JavaScript fallback.
328329
- `ua-parser-js` and `dayjs` are used by the Coder API client.
329330

330331
The coder client is vendored from coder/coder. Pin it to a release tag in

‎pnpm-workspace.yaml‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,14 @@ dedupePeers: true
3232

3333
allowBuilds:
3434
"@vscode/vsce-sign": true
35-
bufferutil: true
35+
# Only win32-arm64 lacks a prebuild, and its JavaScript fallback is fine.
36+
bufferutil: false
3637
electron: true
3738
esbuild: true
3839
keytar: false
3940
odiff-bin: true
4041
unrs-resolver: true
41-
utf-8-validate: true
42+
utf-8-validate: false
4243

4344
overrides:
4445
"@vscode-elements/elements": ^2.5.1

0 commit comments

Comments
 (0)