Skip to content

Commit ae61a98

Browse files
committed
cache playwright browsers
1 parent 22b8f5a commit ae61a98

File tree

2 files changed

+25
-10
lines changed

2 files changed

+25
-10
lines changed

.github/workflows/playwright.yml

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@ on:
1212
branches:
1313
- main
1414

15-
defaults:
16-
run:
17-
# This ensures that the working directory is the root of the repository
18-
working-directory: ./
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: true
1918

2019
permissions:
2120
contents: read
@@ -78,8 +77,30 @@ jobs:
7877
- name: Install packages
7978
run: pnpm install --frozen-lockfile
8079

80+
- name: Get Playwright version
81+
id: playwright-version
82+
working-directory: apps/site
83+
run: echo "version=$(pnpm exec playwright --version | awk '{print $2}')" >> $GITHUB_OUTPUT
84+
85+
- name: Cache Playwright browsers
86+
id: playwright-cache
87+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
88+
with:
89+
path: ~/.cache/ms-playwright
90+
key: playwright-${{ runner.os }}-${{ steps.playwright-version.outputs.version }}
91+
92+
- name: Install Playwright Browsers
93+
run: pnpm exec playwright install --with-deps
94+
8195
- name: Run Playwright tests
8296
working-directory: apps/site
8397
run: pnpm playwright
8498
env:
8599
VERCEL_PREVIEW_URL: ${{ needs.get-vercel-preview.outputs.url }}
100+
101+
- name: Upload Playwright test results
102+
if: always()
103+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
104+
with:
105+
name: playwright-report
106+
path: apps/site/playwright-report/

apps/site/playwright.config.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,4 @@ export default defineConfig({
2929
use: { ...devices['Desktop Safari'] },
3030
},
3131
],
32-
33-
webServer: {
34-
command: 'pnpm dev',
35-
url: 'http://127.0.0.1:3000',
36-
reuseExistingServer: !process.env.CI,
37-
},
3832
});

0 commit comments

Comments
 (0)