forked from Xoulomon/Stellar-Save
-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (43 loc) · 1.3 KB
/
Copy pathvisual-regression.yml
File metadata and controls
52 lines (43 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Visual Regression
on:
pull_request:
branches: [main, develop]
push:
branches: [main]
jobs:
visual:
name: Percy Visual Snapshots
runs-on: ubuntu-latest
# Only run when PERCY_TOKEN is available (skip on forks without the secret)
if: ${{ vars.PERCY_TOKEN != '' || secrets.PERCY_TOKEN != '' }}
defaults:
run:
working-directory: frontend
steps:
- uses: actions/checkout@v4
with:
# Percy needs full git history to associate snapshots with commits
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: frontend/package-lock.json
- name: Install dependencies
run: npm ci
- name: Install Playwright browsers
run: npx playwright install chromium --with-deps
- name: Build frontend
run: npm run build
- name: Run Percy visual snapshots
run: npm run test:visual:ci
env:
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
- name: Upload Playwright artifacts on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: visual-test-results
path: frontend/test-results/
retention-days: 7