Skip to content

Commit d17bcf0

Browse files
committed
Cache Chrome in CI
1 parent 503b33e commit d17bcf0

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,17 @@ jobs:
2727
with:
2828
node-version: lts/*
2929
cache: pnpm
30+
# Put Chrome installed by Puppeteer inside the pnpm store so it gets
31+
# cached.
32+
- name: Set PUPPETEER_CACHE_DIR
33+
shell: bash
34+
run: echo "PUPPETEER_CACHE_DIR=$(pnpm store path)" >> $GITHUB_ENV
3035
- name: Install dependencies
3136
run: pnpm install
37+
# Install Chrome even if it's not needed for this job so it can be cached
38+
# for other jobs.
39+
- name: Install Chrome
40+
run: pnpm install-chrome-for-puppeteer
3241
- name: Lint files
3342
run: pnpm lint
3443
test:
@@ -54,6 +63,11 @@ jobs:
5463
with:
5564
node-version: ${{ matrix.node }}
5665
cache: pnpm
66+
# Put Chrome installed by Puppeteer inside the pnpm store so it gets
67+
# cached.
68+
- name: Set PUPPETEER_CACHE_DIR
69+
shell: bash
70+
run: echo "PUPPETEER_CACHE_DIR=$(pnpm store path)" >> $GITHUB_ENV
5771
- name: Install dependencies
5872
run: pnpm install
5973
- name: Install Chrome

0 commit comments

Comments
 (0)