Skip to content

Commit f178025

Browse files
committed
Add workflow for updating screenshots
1 parent 55afb7f commit f178025

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Deploy static content to Pages
2+
3+
on:
4+
workflow_dispatch:
5+
6+
permissions:
7+
contents: write
8+
9+
jobs:
10+
update-screenshots:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
with:
16+
lfs: true # Download LFS files for screenshots
17+
18+
- name: Set up Node
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: lts/*
22+
cache: 'npm'
23+
24+
- name: Install dependencies
25+
run: npm ci
26+
27+
- name: Run Playwright Tests updating snapshots
28+
run: npx playwright test --update-snapshots
29+
30+
- name: Commit updated snapshots
31+
run: |
32+
git config user.email "[email protected]"
33+
git config user.name "Spock Framework Robot"
34+
git add spock-website/tests/__screenshots__/
35+
if [[ -n "$(git status --porcelain)" ]]; then
36+
echo "::set-output name=has_changes::true"
37+
git commit -m "Update reference screenshots"
38+
git push origin HEAD:${{ github.ref_name }}
39+
else
40+
echo "::set-output name=has_changes::false"
41+
fi

.github/workflows/verify.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ jobs:
5151
with:
5252
node-version: lts/*
5353
cache: 'npm'
54+
5455
- name: Install dependencies
5556
run: npm ci
5657

0 commit comments

Comments
 (0)