Skip to content

Commit 5225fe3

Browse files
mydeaclaude
andcommitted
ci(e2e): Keep install-pnpm unchanged and install pnpm directly in E2E jobs
Only the E2E jobs drop the root node_modules, so only they need another way to get pnpm. Canary, Lighthouse and local runs keep getting it through yarn.lock. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent c3e497e commit 5225fe3

2 files changed

Lines changed: 18 additions & 11 deletions

File tree

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
11
name: 'Install pnpm'
2-
description: 'Installs the pnpm version from the root devDependencies.'
2+
description: 'Puts the pnpm version from the root devDependencies on PATH. Run it after the dependencies are installed.'
33

44
runs:
55
using: 'composite'
66
steps:
77
# The dev dependency is the one pnpm version for CI and local runs. An app that needs another version sets
8-
# `packageManager` in its package.json, and pnpm switches to that version. It is read from package.json rather
9-
# than node_modules, so jobs that don't restore the monorepo's dependencies can use it.
10-
- name: Resolve pnpm version
11-
id: pnpm-version
8+
# `packageManager` in its package.json, and pnpm switches to that version.
9+
- name: Add pnpm to PATH
1210
shell: bash
13-
run: echo "version=$(jq -er '.devDependencies.pnpm' "$GITHUB_WORKSPACE/package.json")" >> "$GITHUB_OUTPUT"
14-
- uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
15-
with:
16-
version: ${{ steps.pnpm-version.outputs.version }}
11+
run: echo "$GITHUB_WORKSPACE/node_modules/pnpm" >> "$GITHUB_PATH"

‎.github/workflows/build.yml‎

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,8 +1088,14 @@ jobs:
10881088
uses: denoland/setup-deno@v2.0.5
10891089
with:
10901090
deno-version: ${{ matrix.deno-version || 'v2.8.3' }}
1091+
# Not `install-pnpm`: it takes pnpm from the root node_modules, which this job doesn't restore.
1092+
- name: Resolve pnpm version
1093+
id: pnpm-version
1094+
run: echo "version=$(jq -er '.devDependencies.pnpm' package.json)" >> "$GITHUB_OUTPUT"
10911095
- name: Install pnpm
1092-
uses: ./.github/actions/install-pnpm
1096+
uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
1097+
with:
1098+
version: ${{ steps.pnpm-version.outputs.version }}
10931099

10941100
- name: Restore tarball artifacts
10951101
uses: actions/download-artifact@v8
@@ -1242,8 +1248,14 @@ jobs:
12421248
uses: denoland/setup-deno@v2.0.5
12431249
with:
12441250
deno-version: ${{ matrix.deno-version || 'v2.8.3' }}
1251+
# Not `install-pnpm`: it takes pnpm from the root node_modules, which this job doesn't restore.
1252+
- name: Resolve pnpm version
1253+
id: pnpm-version
1254+
run: echo "version=$(jq -er '.devDependencies.pnpm' package.json)" >> "$GITHUB_OUTPUT"
12451255
- name: Install pnpm
1246-
uses: ./.github/actions/install-pnpm
1256+
uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
1257+
with:
1258+
version: ${{ steps.pnpm-version.outputs.version }}
12471259

12481260
- name: Restore tarball artifacts
12491261
uses: actions/download-artifact@v8

0 commit comments

Comments
 (0)