From ef388522132b741b8ec221f5cb88e15a5353cdb4 Mon Sep 17 00:00:00 2001 From: Joey Perrott Date: Fri, 22 May 2026 19:21:33 +0000 Subject: [PATCH] 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. (cherry picked from commit a648e8e914cf2515cb1db9b77e366f4781aa67ed) --- .github/workflows/benchmark-compare.yml | 12 ++++++++++++ scripts/benchmarks/index.mts | 4 ++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/benchmark-compare.yml b/.github/workflows/benchmark-compare.yml index e041b2e2dd0..d240439249a 100644 --- a/.github/workflows/benchmark-compare.yml +++ b/.github/workflows/benchmark-compare.yml @@ -36,6 +36,18 @@ jobs: # that the action was triggered by a team member. ref: ${{steps.comment-branch.outputs.head_sha}} + # We cannot use `angular/dev-infra/github-actions/npm/checkout-and-setup-node` here + # because it does not support checking out from a fork (as it lacks a `repository` input). + # Thus, we checkout and setup Node/pnpm manually. + - name: Install pnpm + uses: pnpm/action-setup@903f9c1a6ebcba6cf41d87230be49611ac97822e # v6.0.3 + + - name: Setup Node.js + uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 + with: + node-version-file: '.nvmrc' + cache: 'pnpm' + - run: pnpm install --frozen-lockfile - uses: angular/dev-infra/github-actions/bazel/configure-remote@ba726e7bca0b08b125ccc6f93c233749e1213c17 diff --git a/scripts/benchmarks/index.mts b/scripts/benchmarks/index.mts index ae06736104d..d84d05163d3 100644 --- a/scripts/benchmarks/index.mts +++ b/scripts/benchmarks/index.mts @@ -171,14 +171,14 @@ async function runCompare(bazelTargetRaw: string | undefined, compareRef: string Log.log(green('Checking out comparison revision.')); git.run(['checkout', 'FETCH_HEAD']); - await exec('yarn'); + await exec('pnpm', ['install', '--frozen-lockfile']); await runBenchmarkTarget(bazelTarget); } finally { restoreWorkingStage(git, currentRef); } // Re-install dependencies for `HEAD`. - await exec('yarn'); + await exec('pnpm', ['install', '--frozen-lockfile']); const comparisonResults = await collectBenchmarkResults(testlogPath);