-
Notifications
You must be signed in to change notification settings - Fork 1
67 lines (54 loc) · 1.59 KB
/
visual-testing.yaml
File metadata and controls
67 lines (54 loc) · 1.59 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
name: Visual Testing
on:
pull_request:
branches: [main]
workflow_call:
inputs:
update_snapshots:
description: 'Update snapshots?'
type: boolean
required: false
workflow_dispatch:
inputs:
update_snapshots:
description: 'Update snapshots?'
type: boolean
required: false
jobs:
vrt:
name: Visual Testing
timeout-minutes: 60
# depending on your local setup:
# runs-on: macos-14
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Printout
uses: ./.github/actions/printout
- name: Setup
uses: ./.github/actions/setup
- name: Install Playwright
run: pnpm dlx playwright install --with-deps
- name: Build
run: pnpm build
- 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: apps/storybook/.test/**
- name: Initialize Snapshots
if: ${{ steps.cache.outputs.cache-hit != 'true' || github.event.inputs.update_snapshots == 'true' }}
run: pnpm --filter "storybook" test:update --reporter html
- name: Test - Visual Regressions
run: pnpm --filter "storybook" test
- name: Upload Report
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: apps/storybook/.test/report/
retention-days: 10
overwrite: true