Skip to content

Commit 49c8ff3

Browse files
committed
add Chromatic config, but disabled until Storybook builds properly
1 parent 0fd5e03 commit 49c8ff3

5 files changed

Lines changed: 85 additions & 8 deletions

File tree

.github/workflows/chromatic.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: chromatic
2+
3+
on:
4+
# Temporarily disabled until we can get Storybook to build properly.
5+
# push:
6+
# branches:
7+
# - main
8+
# pull_request:
9+
workflow_dispatch:
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.event.number || github.sha }}
13+
cancel-in-progress: true
14+
15+
permissions:
16+
contents: read
17+
18+
jobs:
19+
chromatic:
20+
name: 📚 Chromatic
21+
runs-on: ubuntu-24.04-arm
22+
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
23+
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
27+
with:
28+
fetch-depth: 0
29+
ref: ${{ github.event.pull_request.head.ref || github.ref }}
30+
31+
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
32+
with:
33+
node-version: lts/*
34+
35+
- uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c # 1e1c8eafbd745f64b1ef30a7d7ed7965034c486c
36+
name: 🟧 Install pnpm
37+
with:
38+
cache: true
39+
40+
- name: 📦 Install dependencies
41+
run: pnpm install
42+
43+
- name: 🧪 Run Chromatic Visual Tests
44+
uses: chromaui/action@a8ce9c58f59be5cc7090cadfc8f130fb08fcf0c3 # v15.1.0
45+
with:
46+
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
47+
env:
48+
CHROMATIC_BRANCH: ${{ github.event.pull_request.head.ref || github.ref_name }}
49+
CHROMATIC_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
50+
CHROMATIC_SLUG: ${{ github.repository }}

chromatic.config.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"onlyChanged": true,
3+
"autoAcceptChanges": "main",
4+
"exitZeroOnChanges": false,
5+
"externals": ["public/**", "app/assets/**", ".storybook/**", "nuxt.config.ts", "uno.config.ts"]
6+
}

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@
4848
"test:unit": "vite test --project unit",
4949
"start:playwright:webserver": "NODE_ENV=test pnpm preview --port 5678",
5050
"storybook": "STORYBOOK=true storybook dev -p 6006",
51-
"build-storybook": "STORYBOOK=true storybook build"
51+
"build-storybook": "STORYBOOK=true storybook build",
52+
"chromatic": "chromatic"
5253
},
5354
"dependencies": {
5455
"@atproto/common": "0.5.10",
@@ -129,6 +130,7 @@
129130
"@vitest/coverage-v8": "4.0.18",
130131
"@vue/test-utils": "2.4.6",
131132
"axe-core": "4.11.1",
133+
"chromatic": "15.1.0",
132134
"defu": "6.1.4",
133135
"eslint-plugin-regexp": "3.0.0",
134136
"fast-check": "4.5.3",

pnpm-lock.yaml

Lines changed: 25 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-workspace.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ overrides:
2424
sharp: 0.34.5
2525
vite: npm:@voidzero-dev/vite-plus-core@0.0.0-833c515fa25cef20905a7f9affb156dfa6f151ab
2626
vitest: npm:@voidzero-dev/vite-plus-test@0.0.0-833c515fa25cef20905a7f9affb156dfa6f151ab
27+
storybook: ^10.2.7
2728

2829
packageExtensions:
2930
'@nuxt/scripts':

0 commit comments

Comments
 (0)