Skip to content

Commit bdea33b

Browse files
committed
chore: skip dependency installation if we have a cache hit
1 parent 4a3e1e6 commit bdea33b

1 file changed

Lines changed: 17 additions & 20 deletions

File tree

.github/workflows/tests.yml

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,18 @@ jobs:
2727
with:
2828
node-version: 22
2929
cache: 'pnpm'
30-
- name: Cache node_modules
30+
- name: Cache dependencies
31+
id: dependencies-cache
3132
uses: actions/cache@v4
3233
with:
3334
path: |
3435
node_modules
3536
apps/*/node_modules
3637
packages/*/node_modules
37-
key: ${{ runner.os }}-node-modules-${{ hashFiles('pnpm-lock.yaml') }}
38-
- name: Cache Playwright browsers
39-
uses: actions/cache@v4
40-
with:
41-
path: ~/.cache/ms-playwright
42-
key: ${{ runner.os }}-playwright-${{ hashFiles('pnpm-lock.yaml') }}
38+
~/.cache/ms-playwright
39+
key: ${{ runner.os }}-deps-${{ hashFiles('pnpm-lock.yaml') }}
4340
- name: Install dependencies
41+
if: steps.dependencies-cache.outputs.cache-hit != 'true'
4442
run: pnpm install
4543
- name: Cache build outputs
4644
id: build-cache
@@ -71,14 +69,15 @@ jobs:
7169
with:
7270
node-version: 22
7371
cache: 'pnpm'
74-
- name: Restore node_modules
72+
- name: Restore dependencies
7573
uses: actions/cache@v4
7674
with:
7775
path: |
7876
node_modules
7977
apps/*/node_modules
8078
packages/*/node_modules
81-
key: ${{ runner.os }}-node-modules-${{ hashFiles('pnpm-lock.yaml') }}
79+
~/.cache/ms-playwright
80+
key: ${{ runner.os }}-deps-${{ hashFiles('pnpm-lock.yaml') }}
8281
- name: Run linting
8382
run: pnpm run lint
8483

@@ -96,14 +95,15 @@ jobs:
9695
with:
9796
node-version: 22
9897
cache: 'pnpm'
99-
- name: Restore node_modules
98+
- name: Restore dependencies
10099
uses: actions/cache@v4
101100
with:
102101
path: |
103102
node_modules
104103
apps/*/node_modules
105104
packages/*/node_modules
106-
key: ${{ runner.os }}-node-modules-${{ hashFiles('pnpm-lock.yaml') }}
105+
~/.cache/ms-playwright
106+
key: ${{ runner.os }}-deps-${{ hashFiles('pnpm-lock.yaml') }}
107107
- name: Restore build outputs
108108
uses: actions/cache@v4
109109
with:
@@ -131,14 +131,15 @@ jobs:
131131
with:
132132
node-version: 22
133133
cache: 'pnpm'
134-
- name: Restore node_modules
134+
- name: Restore dependencies
135135
uses: actions/cache@v4
136136
with:
137137
path: |
138138
node_modules
139139
apps/*/node_modules
140140
packages/*/node_modules
141-
key: ${{ runner.os }}-node-modules-${{ hashFiles('pnpm-lock.yaml') }}
141+
~/.cache/ms-playwright
142+
key: ${{ runner.os }}-deps-${{ hashFiles('pnpm-lock.yaml') }}
142143
- name: Restore build outputs
143144
uses: actions/cache@v4
144145
with:
@@ -166,19 +167,15 @@ jobs:
166167
with:
167168
node-version: 22
168169
cache: 'pnpm'
169-
- name: Restore node_modules
170+
- name: Restore dependencies
170171
uses: actions/cache@v4
171172
with:
172173
path: |
173174
node_modules
174175
apps/*/node_modules
175176
packages/*/node_modules
176-
key: ${{ runner.os }}-node-modules-${{ hashFiles('pnpm-lock.yaml') }}
177-
- name: Restore Playwright browsers
178-
uses: actions/cache@v4
179-
with:
180-
path: ~/.cache/ms-playwright
181-
key: ${{ runner.os }}-playwright-${{ hashFiles('pnpm-lock.yaml') }}
177+
~/.cache/ms-playwright
178+
key: ${{ runner.os }}-deps-${{ hashFiles('pnpm-lock.yaml') }}
182179
- name: Restore build outputs
183180
uses: actions/cache@v4
184181
with:

0 commit comments

Comments
 (0)