@@ -6,11 +6,6 @@ concurrency:
6
6
cancel-in-progress : true
7
7
8
8
env :
9
- CACHE_PATH : |
10
- **/node_modules
11
- ~/.cache/Cypress
12
- YARN_CACHE_PATH : |
13
- ~/.pnpm-store
14
9
FILES_TO_DELETE : |
15
10
sudo rm -rf "/usr/share/dotnet"
16
11
sudo rm -rf "/usr/share/swift"
@@ -130,14 +125,26 @@ jobs:
130
125
- name : Setup pnpm cache
131
126
uses : actions/cache@v4
132
127
with :
133
- path : |
134
- ${{ steps.pnpm-cache.outputs.STORE_PATH }}
135
- **/node_modules
136
- ~/.cache/Cypress
137
- ~/.cache/ms-playwright
138
- key : deps-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
128
+ path : ${{ steps.pnpm-cache.outputs.STORE_PATH }}
129
+ key : pnpm-store-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
139
130
restore-keys : |
140
- deps-${{ runner.os }}-
131
+ pnpm-store-${{ runner.os }}-
132
+
133
+ - name : Cache Cypress binary
134
+ uses : actions/cache@v4
135
+ with :
136
+ path : ~/.cache/Cypress
137
+ key : cypress-${{ runner.os }}-cypress-13.12.0
138
+ restore-keys : |
139
+ cypress-${{ runner.os }}-
140
+
141
+ - name : Cache Playwright browsers
142
+ uses : actions/cache@v4
143
+ with :
144
+ path : ~/.cache/ms-playwright
145
+ key : playwright-${{ runner.os }}-1.54.2
146
+ restore-keys : |
147
+ playwright-${{ runner.os }}-
141
148
142
149
- name : Install dependencies
143
150
run : |
@@ -191,37 +198,70 @@ jobs:
191
198
run : |
192
199
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
193
200
194
- - name : Restore dependency cache
201
+ - name : Restore pnpm cache
195
202
uses : actions/cache/restore@v4
196
- id : deps-cache
197
- with :
198
- path : |
199
- ${{ steps.pnpm-cache.outputs.STORE_PATH }}
200
- **/node_modules
201
- ~/.cache/Cypress
202
- ~/.cache/ms-playwright
203
- key : deps-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
203
+ id : pnpm-store-cache
204
+ with :
205
+ path : ${{ steps.pnpm-cache.outputs.STORE_PATH }}
206
+ key : pnpm-store-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
204
207
restore-keys : |
205
- deps -${{ runner.os }}-
208
+ pnpm-store -${{ runner.os }}-
206
209
fail-on-cache-miss : false
207
210
208
- - name : Install deps if cache miss
211
+ - name : Restore Cypress cache
212
+ uses : actions/cache/restore@v4
213
+ id : cypress-cache
214
+ with :
215
+ path : ~/.cache/Cypress
216
+ key : cypress-${{ runner.os }}-cypress-13.12.0
217
+ restore-keys : |
218
+ cypress-${{ runner.os }}-
219
+ fail-on-cache-miss : false
220
+
221
+ - name : Restore Playwright cache
222
+ if : matrix.container == 'bi-directional'
223
+ uses : actions/cache/restore@v4
224
+ id : playwright-cache
225
+ with :
226
+ path : ~/.cache/ms-playwright
227
+ key : playwright-${{ runner.os }}-1.54.2
228
+ restore-keys : |
229
+ playwright-${{ runner.os }}-
230
+ fail-on-cache-miss : false
231
+
232
+ - name : Install dependencies
209
233
id : install-deps-e2e
210
- if : steps.deps-cache.outputs.cache-hit != 'true'
211
234
env :
212
235
NODE_OPTIONS : ' --max_old_space_size=6144'
213
236
FORCE_COLOR : 3
214
237
run : |
215
- echo "Cache miss - this should not happen as deps were installed in setup-matrix job "
238
+ echo "Installing dependencies from cached pnpm store... "
216
239
pnpm install --frozen-lockfile --prefer-offline
217
- npx cypress verify
240
+
241
+ # Verify Cypress if needed
242
+ if [ "${{ steps.cypress-cache.outputs.cache-hit }}" != "true" ]; then
243
+ echo "Installing Cypress binary..."
244
+ npx cypress install
245
+ else
246
+ echo "Cypress binary already cached"
247
+ npx cypress verify || true
248
+ fi
218
249
219
250
- name : Install Playwright for projects that need it
220
251
run : |
221
252
if [ "${{ matrix.container }}" = "bi-directional" ]; then
222
- echo "Installing Playwright for bi-directional example..."
253
+ echo "Setting up Playwright for bi-directional example..."
223
254
cd ${{ matrix.container }}
224
- npx playwright install --with-deps chromium
255
+
256
+ # Check if Playwright browsers are already cached
257
+ if [ "${{ steps.playwright-cache.outputs.cache-hit }}" = "true" ] && [ -d "$HOME/.cache/ms-playwright" ]; then
258
+ echo "Playwright browsers already cached, installing system dependencies only..."
259
+ npx playwright install-deps chromium
260
+ else
261
+ echo "Installing Playwright browsers and dependencies..."
262
+ npx playwright install --with-deps chromium
263
+ fi
264
+
225
265
cd ..
226
266
fi
227
267
0 commit comments