Skip to content

Commit d39e3af

Browse files
committed
ci: add workflow to update e2e snapshots
1 parent 7f6dae9 commit d39e3af

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Update E2E Snapshots
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
branch:
7+
description: 'Branch to update snapshots on'
8+
required: true
9+
default: 'main'
10+
11+
permissions:
12+
contents: write
13+
14+
jobs:
15+
update-snapshots:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
with:
20+
ref: ${{ github.event.inputs.branch }}
21+
token: ${{ secrets.GITHUB_TOKEN }}
22+
23+
- uses: oven-sh/setup-bun@v2
24+
with:
25+
bun-version: latest
26+
27+
- uses: actions/setup-node@v4
28+
with:
29+
node-version: "20"
30+
31+
- uses: astral-sh/setup-uv@v5
32+
33+
- run: npm ci
34+
35+
- name: Install Playwright browsers
36+
run: npx playwright install --with-deps chromium
37+
38+
- name: Update snapshots
39+
run: npx playwright test --update-snapshots --reporter=list
40+
41+
- name: Commit updated snapshots
42+
run: |
43+
git config user.name "github-actions[bot]"
44+
git config user.email "github-actions[bot]@users.noreply.github.com"
45+
git add tests/e2e/**/*.png
46+
git diff --staged --quiet || git commit -m "chore: update e2e snapshots [skip ci]"
47+
git push

0 commit comments

Comments
 (0)