2026-03-31 17:15:54 +00:00
|
|
|
# Chromatic: visual regression testing for Storybook.
|
|
|
|
|
# Runs on every push/PR that touches the web app.
|
|
|
|
|
# Requires CHROMATIC_PROJECT_TOKEN secret in GitHub repo settings.
|
|
|
|
|
name: Chromatic
|
|
|
|
|
|
|
|
|
|
on:
|
2026-04-09 15:39:10 +00:00
|
|
|
push:
|
|
|
|
|
branches: [main, develop]
|
|
|
|
|
paths:
|
|
|
|
|
- "apps/web/**"
|
|
|
|
|
- ".github/workflows/chromatic.yml"
|
|
|
|
|
pull_request:
|
|
|
|
|
paths:
|
|
|
|
|
- "apps/web/**"
|
|
|
|
|
- ".github/workflows/chromatic.yml"
|
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
|
|
env:
|
|
|
|
|
GIT_SSL_NO_VERIFY: "true"
|
|
|
|
|
NODE_TLS_REJECT_UNAUTHORIZED: "0"
|
2026-03-31 17:15:54 +00:00
|
|
|
|
|
|
|
|
jobs:
|
2026-04-09 15:39:10 +00:00
|
|
|
chromatic:
|
|
|
|
|
name: Visual regression tests
|
|
|
|
|
runs-on: ubuntu-latest
|
2026-03-31 17:15:54 +00:00
|
|
|
|
2026-04-09 15:39:10 +00:00
|
|
|
steps:
|
|
|
|
|
- name: Checkout
|
|
|
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
|
|
|
with:
|
|
|
|
|
fetch-depth: 0 # Required for Chromatic to detect changes
|
2026-03-31 17:15:54 +00:00
|
|
|
|
2026-04-09 15:39:10 +00:00
|
|
|
- name: Set up Node
|
|
|
|
|
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
|
|
|
|
|
with:
|
|
|
|
|
node-version: "20"
|
|
|
|
|
cache: "npm"
|
2026-03-31 17:15:54 +00:00
|
|
|
|
2026-04-09 15:39:10 +00:00
|
|
|
- name: Install dependencies
|
|
|
|
|
run: npm ci
|
|
|
|
|
working-directory: apps/web
|
2026-03-31 17:15:54 +00:00
|
|
|
|
2026-04-09 15:39:10 +00:00
|
|
|
- name: Run Chromatic
|
|
|
|
|
uses: chromaui/action@latest
|
|
|
|
|
with:
|
|
|
|
|
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
|
|
|
|
|
workingDir: apps/web
|
|
|
|
|
buildScriptName: build-storybook
|
|
|
|
|
exitZeroOnChanges: true # Don't fail PR on visual changes, just flag them
|
|
|
|
|
exitOnceUploaded: true # Speed up CI — don't wait for full processing
|
|
|
|
|
onlyChanged: true # Only snapshot stories affected by changes
|
|
|
|
|
externals: |
|
|
|
|
|
apps/web/src/**/*.css
|
|
|
|
|
apps/web/public/**
|
|
|
|
|
env:
|
|
|
|
|
VITE_API_URL: /api/v1
|
|
|
|
|
VITE_USE_MSW: "true"
|
|
|
|
|
VITE_STORYBOOK: "true"
|