Skip to content

Commit a648e8e

Browse files
josephperrottalxhub
authored andcommitted
ci: configure setup and use pnpm in benchmark comparison workflow
The benchmark comparison workflow fails because it runs pnpm install without setting up node and pnpm first. We configure the setup steps manually so that checkouts from forks are supported. Additionally, we update the benchmark comparison script (index.mts) to use pnpm rather than hardcoded yarn commands to install dependencies when checking out revisions.
1 parent 26f4ed5 commit a648e8e

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

.github/workflows/benchmark-compare.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,18 @@ jobs:
3636
# that the action was triggered by a team member.
3737
ref: ${{steps.comment-branch.outputs.head_sha}}
3838

39+
# We cannot use `angular/dev-infra/github-actions/npm/checkout-and-setup-node` here
40+
# because it does not support checking out from a fork (as it lacks a `repository` input).
41+
# Thus, we checkout and setup Node/pnpm manually.
42+
- name: Install pnpm
43+
uses: pnpm/action-setup@903f9c1a6ebcba6cf41d87230be49611ac97822e # v6.0.3
44+
45+
- name: Setup Node.js
46+
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
47+
with:
48+
node-version-file: '.nvmrc'
49+
cache: 'pnpm'
50+
3951
- run: pnpm install --frozen-lockfile
4052

4153
- uses: angular/dev-infra/github-actions/bazel/configure-remote@442c2fcbf06a321b5196b4c5fc70e78a49242958

scripts/benchmarks/index.mts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,14 +171,14 @@ async function runCompare(bazelTargetRaw: string | undefined, compareRef: string
171171
Log.log(green('Checking out comparison revision.'));
172172
git.run(['checkout', 'FETCH_HEAD']);
173173

174-
await exec('yarn');
174+
await exec('pnpm', ['install', '--frozen-lockfile']);
175175
await runBenchmarkTarget(bazelTarget);
176176
} finally {
177177
restoreWorkingStage(git, currentRef);
178178
}
179179

180180
// Re-install dependencies for `HEAD`.
181-
await exec('yarn');
181+
await exec('pnpm', ['install', '--frozen-lockfile']);
182182

183183
const comparisonResults = await collectBenchmarkResults(testlogPath);
184184

0 commit comments

Comments
 (0)