Skip to content

Commit 58906de

Browse files
committedNov 6, 2023
ci: install playwright manually
1 parent 08c6899 commit 58906de

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed
 

Diff for: ‎.github/workflows/ci.yml

+26
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,32 @@ jobs:
5959
- name: Install dependencies
6060
run: pnpm install
6161

62+
# Install playwright's binary under custom directory to cache
63+
- name: (non-windows) Set Playwright path and Get playwright version
64+
if: runner.os != 'Windows'
65+
run: |
66+
echo "PLAYWRIGHT_BROWSERS_PATH=$HOME/.cache/playwright-bin" >> $GITHUB_ENV
67+
PLAYWRIGHT_VERSION="$(pnpm ls --depth 0 --json -w playwright | jq --raw-output '.[0].unsavedDependencies["playwright"].version')"
68+
echo "PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION" >> $GITHUB_ENV
69+
70+
- name: (windows) Set Playwright path and Get playwright version
71+
if: runner.os == 'Windows'
72+
run: |
73+
echo "PLAYWRIGHT_BROWSERS_PATH=$HOME\.cache\playwright-bin" >> $env:GITHUB_ENV
74+
$env:PLAYWRIGHT_VERSION="$(pnpm ls --depth 0 --json -w playwright | jq --raw-output '.[0].unsavedDependencies[\"playwright\"].version')"
75+
echo "PLAYWRIGHT_VERSION=$env:PLAYWRIGHT_VERSION" >> $env:GITHUB_ENV
76+
77+
- name: Cache Playwright's binary
78+
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
79+
with:
80+
key: ${{ runner.os }}-playwright-bin-v1-${{ env.PLAYWRIGHT_VERSION }}
81+
path: ${{ env.PLAYWRIGHT_BROWSERS_PATH }}
82+
restore-keys: |
83+
${{ runner.os }}-playwright-bin-v1-
84+
85+
- name: Install Playwright
86+
run: pnpm playwright-core install chromium
87+
6288
- name: Build module
6389
run: pnpm prepack
6490

0 commit comments

Comments
 (0)
Please sign in to comment.