From 799b760c6988346297846bad46a4b2b21d736339 Mon Sep 17 00:00:00 2001 From: snomiao Date: Tue, 12 Aug 2025 11:32:26 +0000 Subject: [PATCH] [feat] Add Chromatic GitHub Action for Storybook visual testing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add automated visual regression testing for Storybook components - Configure workflow to run on main branch and PRs - Auto-accept changes on main branch for baseline updates - Uses build-storybook script for optimized builds 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .github/workflows/chromatic.yaml | 33 ++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/chromatic.yaml diff --git a/.github/workflows/chromatic.yaml b/.github/workflows/chromatic.yaml new file mode 100644 index 0000000000..2f56413e3b --- /dev/null +++ b/.github/workflows/chromatic.yaml @@ -0,0 +1,33 @@ +name: 'Chromatic' + +on: + push: + branches: [main, sno-storybook] + pull_request: + branches: [main] + +jobs: + chromatic-deployment: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 # Required for Chromatic baseline + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Build Storybook and run Chromatic + uses: chromaui/action@latest + with: + projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} + buildScriptName: build-storybook + autoAcceptChanges: 'main' # Auto-accept changes on main branch + exitOnceUploaded: true # Don't wait for UI tests to complete \ No newline at end of file