-
Notifications
You must be signed in to change notification settings - Fork 92
155 lines (130 loc) · 4.34 KB
/
visual-tests.yml
File metadata and controls
155 lines (130 loc) · 4.34 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
name: Visual tests
on:
pull_request:
types: [opened, synchronize, reopened]
permissions:
contents: read
env:
_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
jobs:
base:
environment: ${{ github.event.pull_request.head.repo.fork && 'PR-validation' || '' }}
name: Base
runs-on: ubuntu-latest
if: github.repository_owner == 'vaadin'
container:
image: mcr.microsoft.com/playwright:v1.59.1-noble
options: --ipc=host
steps:
- uses: actions/checkout@v6
with:
fetch-depth: '0'
ref: ${{ env._HEAD_SHA }}
- name: Fetch origin/main
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
git fetch origin main
- name: Cache node_modules
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
- name: Install Dependencies
run: yarn --frozen-lockfile --no-progress --non-interactive
- name: Visual tests
uses: nick-fields/retry@v3
with:
timeout_minutes: 20
retry_wait_seconds: 60
max_attempts: 3
command: yarn test --config web-test-runner-base.config.js
- uses: actions/upload-artifact@v6
if: ${{ failure() }}
with:
name: base-screenshots
path: |
packages/*/test/visual/base/screenshots/*/failed/*.png
lumo:
environment: ${{ github.event.pull_request.head.repo.fork && 'PR-validation' || '' }}
name: Lumo
runs-on: ubuntu-latest
if: github.repository_owner == 'vaadin'
container:
image: mcr.microsoft.com/playwright:v1.59.1-noble
options: --ipc=host
steps:
- uses: actions/checkout@v6
with:
fetch-depth: '0'
ref: ${{ env._HEAD_SHA }}
- name: Fetch origin/main
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
git fetch origin main
- name: Cache node_modules
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
- name: Install Dependencies
run: yarn --frozen-lockfile --no-progress --non-interactive
- name: Visual tests
uses: nick-fields/retry@v3
with:
timeout_minutes: 20
retry_wait_seconds: 60
max_attempts: 3
command: yarn test --config web-test-runner-lumo.config.js
- uses: actions/upload-artifact@v6
if: ${{ failure() }}
with:
name: lumo-screenshots
path: |
packages/*/test/visual/lumo/screenshots/*/failed/*.png
packages/vaadin-lumo-styles/test/visual/screenshots/failed/*.png
aura:
environment: ${{ github.event.pull_request.head.repo.fork && 'PR-validation' || '' }}
name: Aura
runs-on: ubuntu-latest
if: github.repository_owner == 'vaadin'
container:
image: mcr.microsoft.com/playwright:v1.59.1-noble
options: --ipc=host
steps:
- uses: actions/checkout@v6
with:
fetch-depth: '0'
ref: ${{ env._HEAD_SHA }}
- name: Fetch origin/main
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
git fetch origin main
- name: Cache node_modules
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
- name: Install Dependencies
run: yarn --frozen-lockfile --no-progress --non-interactive
- name: Visual tests (default)
uses: nick-fields/retry@v3
with:
timeout_minutes: 20
retry_wait_seconds: 60
max_attempts: 3
command: yarn test --config web-test-runner-aura.config.js
- name: Visual tests (dark)
uses: nick-fields/retry@v3
with:
timeout_minutes: 20
retry_wait_seconds: 60
max_attempts: 3
command: yarn test --config web-test-runner-aura.config.js --dark
- uses: actions/upload-artifact@v6
if: ${{ failure() }}
with:
name: aura-screenshots
path: |
packages/*/test/visual/aura/screenshots/dark/*/failed/*.png
packages/*/test/visual/aura/screenshots/default/*/failed/*.png