Repository navigation
82 lines (70 loc) · 2.28 KB
/
Copy pathvisual-diff.yaml
File metadata and controls
82 lines (70 loc) · 2.28 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: visual regression
on:
push:
branches: [master]
paths:
- 'web/**'
- 'assets/design-export/**'
- '.github/workflows/visual-diff.yaml'
pull_request:
paths:
- 'web/**'
- 'assets/design-export/**'
- '.github/workflows/visual-diff.yaml'
workflow_dispatch:
permissions:
contents: read
concurrency:
group: visual-diff-${{ github.ref }}
cancel-in-progress: true
jobs:
visual-diff:
name: design vs browser visual diff
runs-on: ubuntu-latest
permissions:
contents: read
timeout-minutes: 20
defaults:
run:
working-directory: web
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: "24"
cache: "npm"
cache-dependency-path: web/package-lock.json
- name: install dependencies
run: npm ci
- name: playwright browser cache
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('web/package-lock.json') }}
restore-keys: |
playwright-${{ runner.os }}-${{ runner.arch }}-
- name: install chromium
run: npx playwright install --with-deps chromium
- name: capture browser screenshots
run: npm run screenshots:design
- name: compare design baseline vs browser captures
if: always()
run: npm run diff:screenshots -- --check-expected
- name: upload visual diff artifacts
if: always()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: visual-diff-report
path: web/test-results/visual-diff
retention-days: 14
if-no-files-found: warn
- name: upload original browser captures
if: always()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: browser-screenshot-captures
path: web/e2e/screenshots/*.png
retention-days: 14
if-no-files-found: warn