-
Notifications
You must be signed in to change notification settings - Fork 3
70 lines (58 loc) · 1.64 KB
/
playwright.yml
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
name: Visual Regression Tests
on:
push:
branches: [main]
# Allow updating snapshots during manual runs
workflow_call:
inputs:
update-snapshots:
description: 'Update snapshots?'
type: boolean
# Allow updating snapshots during automatic runs
workflow_dispatch:
inputs:
update-snapshots:
description: 'Update snapshots?'
type: boolean
env:
NPM_TOKEN: ${{secrets.NPM_TOKEN}}
CI: true
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set Node
uses: actions/setup-node@v3
with:
node-version: '18.x'
- name: Install dependencies
run: yarn
- name: Install Playwright Browsers
run: yarn playwright install --with-deps
- name: Build Storybook
run: |
yarn build:storybook
- name: Set up cache
id: cache
uses: actions/cache@v4
with:
key: cache/${{github.repository}}/${{github.ref}}
restore-keys: cache/${{github.repository}}/refs/heads/main
path: .visual-test/**
- name: Initialize snapshots
if: ${{steps.cache.outputs.cache-hit != 'true' || inputs.update-snapshots == true}}
run: npx playwright test --update-snapshots --reporter html
- name: Run Playwright tests
run: yarn playwright test
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: .visual-test/spec/results/
retention-days: 30
overwrite: true