Skip to content

Commit 4d9df43

Browse files
committed
ci: install playwright binaries
1 parent 3ffaa61 commit 4d9df43

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,28 @@ jobs:
1919
node-version: 16
2020
cache: "pnpm"
2121
- run: pnpm install
22+
23+
# https://github.com/vitejs/vite/blob/main/.github/workflows/ci.yml#L62
24+
# Install playwright's binary under custom directory to cache
25+
- name: Set Playwright path (non-windows)
26+
if: runner.os != 'Windows'
27+
run: echo "PLAYWRIGHT_BROWSERS_PATH=$HOME/.cache/playwright-bin" >> $GITHUB_ENV
28+
- name: Set Playwright path (windows)
29+
if: runner.os == 'Windows'
30+
run: echo "PLAYWRIGHT_BROWSERS_PATH=$HOME\.cache\playwright-bin" >> $env:GITHUB_ENV
31+
32+
- name: Cache Playwright's binary
33+
uses: actions/cache@v3
34+
with:
35+
# Playwright removes unused browsers automatically
36+
# So does not need to add playwright version to key
37+
key: ${{ runner.os }}-playwright-bin-v1
38+
path: ${{ env.PLAYWRIGHT_BROWSERS_PATH }}
39+
40+
- name: Install Playwright
41+
# does not need to explicitly set chromium after https://github.com/microsoft/playwright/issues/14862 is solved
42+
run: pnpm playwright install chromium
43+
2244
- run: pnpm dev:prepare
2345
- run: pnpm lint
2446
- run: pnpm test

0 commit comments

Comments
 (0)