From 1730ea13acec7441bc9a8c3702e4fcac2b96328e Mon Sep 17 00:00:00 2001 From: Alan Agius <17563226+alan-agius4@users.noreply.github.com> Date: Thu, 28 Aug 2025 12:35:35 +0000 Subject: [PATCH] ci: fix and improve devtools step (#63441) This commit updates the devtools step by disabling the package manager cache. This change is necessary because Cypress downloads its binary to a cache directory during installation, which requires a post-install script. However, when the cache is hit this is skipped. This update also disables `pnpm install` in the Cypress action to avoid a redundant installation step. And adds a seperate cache for the downloaded Cypress binary. See: https://docs.cypress.io/app/get-started/install-cypress#pnpm-configuration PR Close #63441 --- .github/workflows/ci.yml | 8 +++++++- .github/workflows/pr.yml | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8afa7871144..d733f328976 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,13 +43,18 @@ jobs: - name: Initialize environment uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@7e2eefa1375195fa7616f78a76f538a188852067 with: - cache-node-modules: true + disable-package-manager-cache: true - name: Setup Bazel uses: angular/dev-infra/github-actions/bazel/setup@7e2eefa1375195fa7616f78a76f538a188852067 - name: Setup Bazel RBE uses: angular/dev-infra/github-actions/bazel/configure-remote@7e2eefa1375195fa7616f78a76f538a188852067 with: google_credential: ${{ secrets.RBE_TRUSTED_BUILDS_USER }} + - name: Cache downloaded Cypress binary + uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 + with: + path: '~/.cache/Cypress' + key: cypress-cache-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} - name: Install node modules run: pnpm install --frozen-lockfile - name: Run unit tests @@ -63,6 +68,7 @@ jobs: start: pnpm bazel run //devtools/src:devserver wait-on: 'http://localhost:4200' wait-on-timeout: 300 + install: false test: runs-on: ubuntu-latest-4core diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index a347098085d..79b7269c2b9 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -49,11 +49,16 @@ jobs: - name: Initialize environment uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@7e2eefa1375195fa7616f78a76f538a188852067 with: - cache-node-modules: true + disable-package-manager-cache: true - name: Setup Bazel uses: angular/dev-infra/github-actions/bazel/setup@7e2eefa1375195fa7616f78a76f538a188852067 - name: Setup Bazel RBE uses: angular/dev-infra/github-actions/bazel/configure-remote@7e2eefa1375195fa7616f78a76f538a188852067 + - name: Cache downloaded Cypress binary + uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 + with: + path: '~/.cache/Cypress' + key: cypress-cache-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} - name: Install node modules run: pnpm install --frozen-lockfile - name: Run unit tests @@ -67,6 +72,7 @@ jobs: start: pnpm bazel run //devtools/src:devserver wait-on: 'http://localhost:4200' wait-on-timeout: 300 + install: false test: runs-on: ubuntu-latest-8core