-
Notifications
You must be signed in to change notification settings - Fork 1
55 lines (50 loc) · 1.63 KB
/
visual_regression_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
44
45
46
47
48
49
50
51
52
53
54
55
name: "Visual Tests"
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
push:
paths:
- "packages/**"
jobs:
install-cache:
name: Install and cache dependencies
if: ${{ github.triggering_actor != 'dependabot[bot]' && contains(github.event.pull_request.draft, false) }}
runs-on: ubuntu-latest
steps:
- run: echo ${{ github.triggering_actor }}
- name: Checkout Commit
uses: actions/checkout@v4
- name: Cache yarn dependencies
uses: actions/cache@v3
id: yarn-cache
with:
path: node_modules
key: ${{ runner.os }}-yarn-v1-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-v1
- name: Install dependencies if cache invalid
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn
visual-tests:
name: Run visual tests with Chromatic
runs-on: ubuntu-latest
if: contains(github.event.pull_request.draft, false)
needs: install-cache
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Required to retrieve git history
- name: Restore yarn dependencies
uses: actions/cache@v3
id: yarn-cache
with:
path: node_modules
key: ${{ runner.os }}-yarn-v1-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-v1
- name: Build packages
run: yarn build
- name: Publish to Chromatic
uses: chromaui/action@v1
with:
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
autoAcceptChanges: "main"
exitOnceUploaded: true