Skip to content

Commit 1730ea1

Browse files
alan-agius4thePunderWoman
authored andcommitted
ci: fix and improve devtools step (angular#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 angular#63441
1 parent 6235d34 commit 1730ea1

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,18 @@ jobs:
4343
- name: Initialize environment
4444
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@7e2eefa1375195fa7616f78a76f538a188852067
4545
with:
46-
cache-node-modules: true
46+
disable-package-manager-cache: true
4747
- name: Setup Bazel
4848
uses: angular/dev-infra/github-actions/bazel/setup@7e2eefa1375195fa7616f78a76f538a188852067
4949
- name: Setup Bazel RBE
5050
uses: angular/dev-infra/github-actions/bazel/configure-remote@7e2eefa1375195fa7616f78a76f538a188852067
5151
with:
5252
google_credential: ${{ secrets.RBE_TRUSTED_BUILDS_USER }}
53+
- name: Cache downloaded Cypress binary
54+
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
55+
with:
56+
path: '~/.cache/Cypress'
57+
key: cypress-cache-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
5358
- name: Install node modules
5459
run: pnpm install --frozen-lockfile
5560
- name: Run unit tests
@@ -63,6 +68,7 @@ jobs:
6368
start: pnpm bazel run //devtools/src:devserver
6469
wait-on: 'http://localhost:4200'
6570
wait-on-timeout: 300
71+
install: false
6672

6773
test:
6874
runs-on: ubuntu-latest-4core

.github/workflows/pr.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,16 @@ jobs:
4949
- name: Initialize environment
5050
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@7e2eefa1375195fa7616f78a76f538a188852067
5151
with:
52-
cache-node-modules: true
52+
disable-package-manager-cache: true
5353
- name: Setup Bazel
5454
uses: angular/dev-infra/github-actions/bazel/setup@7e2eefa1375195fa7616f78a76f538a188852067
5555
- name: Setup Bazel RBE
5656
uses: angular/dev-infra/github-actions/bazel/configure-remote@7e2eefa1375195fa7616f78a76f538a188852067
57+
- name: Cache downloaded Cypress binary
58+
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
59+
with:
60+
path: '~/.cache/Cypress'
61+
key: cypress-cache-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
5762
- name: Install node modules
5863
run: pnpm install --frozen-lockfile
5964
- name: Run unit tests
@@ -67,6 +72,7 @@ jobs:
6772
start: pnpm bazel run //devtools/src:devserver
6873
wait-on: 'http://localhost:4200'
6974
wait-on-timeout: 300
75+
install: false
7076

7177
test:
7278
runs-on: ubuntu-latest-8core

0 commit comments

Comments
 (0)