Skip to content

Commit af20bdc

Browse files
committed
Cache playwright browser
1 parent 986f85f commit af20bdc

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

.github/workflows/e2e-tests.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,23 @@ jobs:
2424
- name: Install dependencies
2525
run: npm ci
2626

27+
- name: Store Playwright's Version
28+
run: |
29+
PLAYWRIGHT_VERSION=$(npm ls @playwright/test | grep @playwright | sed 's/.*@//')
30+
echo "Playwright's Version: $PLAYWRIGHT_VERSION"
31+
echo "PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION" >> $GITHUB_ENV
32+
33+
- name: Cache Playwright Browsers for Playwright's Version
34+
id: cache-playwright-browsers
35+
uses: actions/cache@v4
36+
with:
37+
path: ~/.cache/ms-playwright
38+
key: playwright-browsers-${{ env.PLAYWRIGHT_VERSION }}
39+
40+
- name: Setup Playwright
41+
if: steps.cache-playwright-browsers.outputs.cache-hit != 'true'
42+
run: npx playwright install --with-deps
43+
2744
- name: Install Playwright Browsers
2845
run: npx playwright install --with-deps
2946

0 commit comments

Comments
 (0)