-
Notifications
You must be signed in to change notification settings - Fork 25
65 lines (56 loc) · 1.84 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
56
57
58
59
60
61
62
63
64
65
name: Visual Regression Tests
#Rationale for not including it in default CI workflow, Chromatic requires 'on push' vs 'on pull request'
on:
push:
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
jobs:
visual-regression-tests:
name: ${{ matrix.package }}
runs-on: ubuntu-latest
strategy:
matrix:
include:
- package: '@kadena/react-ui'
path: packages/libs/react-ui
projectToken: 'REACT_UI_CHROMATIC_TOKEN'
- package: '@kadena/docs'
path: packages/apps/docs
projectToken: 'DOCS_CHROMATIC_TOKEN'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 #Required to retrieve git history, needed to determine diffs.
show-progress: false
- uses: dorny/paths-filter@v2
id: changed
with:
filters: |
pathFilter:
- '${{ matrix.path }}/**'
- uses: pnpm/action-setup@v2
if: steps.changed.outputs.pathFilter == 'true'
with:
version: 8
- uses: actions/setup-node@v3
if: steps.changed.outputs.pathFilter == 'true'
with:
node-version: 18
cache: 'pnpm'
- name: Install dependencies
if: steps.changed.outputs.pathFilter == 'true'
run: pnpm install
- name: Build
if: steps.changed.outputs.pathFilter == 'true'
run: pnpm run build
- name: Publish Storybook
if: steps.changed.outputs.pathFilter == 'true'
uses: chromaui/action@v1
with:
exitOnceUploaded: true
buildScriptName: 'build:storybook'
projectToken: ${{ secrets[matrix.projectToken] }}
workingDir: ${{ matrix.path }}
autoAcceptChanges: 'main'
onlyChanged: true # Required option to enable TurboSnap