-
Notifications
You must be signed in to change notification settings - Fork 1
69 lines (59 loc) · 2.36 KB
/
chromatic.yml
File metadata and controls
69 lines (59 loc) · 2.36 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
68
69
name: Chromatic for pull requests
on:
workflow_run:
workflows:
# On PR, to trigger visual regression testing
- Continuous Integration
# On push to main, to set new baseline
- publish
types:
- completed
permissions:
# Read the contents of the repo
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.workflow_run.head_branch }}
cancel-in-progress: true
jobs:
chromatic:
# Only run if the Continuous Integration workflow was successful
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
# Use the correct ref to check out
ref: ${{ github.event.workflow_run.head_sha }}
# Make sure that history is available to Chromatic
fetch-depth: 0
- name: Install pnpm package manager
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
- name: Set up Node.js version and cache
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version-file: .nvmrc
- name: Check for known security issues with npm packages
run: |
echo "Auditing dependencies. For more information, see: https://nldesignsystem.nl/pnpm-audit"
pnpm audit --audit-level critical
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Download visual-regression-testing artifact
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
with:
name: visual-regression-testing
# Needed to download an artifact created in a different workflow
github-token: ${{ github.token }}
run-id: ${{ github.event.workflow_run.id }}
path: packages/storybook-test/dist/
- name: Chromatic
uses: chromaui/action@07791f8243f4cb2698bf4d00426baf4b2d1cb7e0 # v13.3.5
with:
autoAcceptChanges: main
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
storybookBaseDir: packages/storybook-test/
storybookBuildDir: packages/storybook-test/dist/
storybookConfigDir: packages/storybook-test/config/
exitOnceUploaded: true
onlyChanged: true