-
Notifications
You must be signed in to change notification settings - Fork 38
43 lines (41 loc) · 1.15 KB
/
visual-tests.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
name: Visual tests
on:
workflow_dispatch:
pull_request:
branches: [main, next]
types:
# Ensure workflow is run when PR is ready for review
- ready_for_review
# Also enable the default trigger types, for instances when
# the PR is not opened as a draft first
- opened
- reopened
- synchronize
paths:
- .github/workflows/visual-tests.yml
- 'packages/**'
- 'apps/storybook/**'
push:
branches: [main, next]
jobs:
checks:
name: Build & run visual/interaction tests
runs-on: ubuntu-latest
if: ${{ !github.event.pull_request.draft }}
steps:
- uses: actions/checkout@v4
with:
# Necessary for Chromatic
fetch-depth: 0
- uses: ./.github/actions/gh-setup
- name: Build
run: yarn build
- name: Build storybook
run: yarn build:storybook
- name: Run Chromatic (visual and interaction tests)
uses: chromaui/action@latest
with:
workingDir: apps/storybook
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
exitZeroOnChanges: true
autoAcceptChanges: '{main,next}'