From 29654777a3c607abda18c9c95c3b3620f9b8c1a4 Mon Sep 17 00:00:00 2001 From: Ben Elan Date: Wed, 23 Oct 2024 17:02:41 -0700 Subject: [PATCH] ci(chromatic): build storybook even when skipping snapshots (#10589) ## Summary There have been a few occasions where storybook build errors made it onto `dev` due to skipping snapshots. This will ensure storybook always builds and catches errors, even if it isn't uploaded to chromatic. --- .github/workflows/chromatic.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/chromatic.yml b/.github/workflows/chromatic.yml index e5eed78c099..7eabddaa911 100644 --- a/.github/workflows/chromatic.yml +++ b/.github/workflows/chromatic.yml @@ -7,8 +7,6 @@ on: types: [opened, labeled, synchronize] jobs: run: - if: | - (github.event.action == 'labeled' && github.event.label.name == 'pr ready for visual snapshots') || github.event_name == 'push' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -17,11 +15,18 @@ jobs: - uses: actions/setup-node@v4 with: node-version-file: package.json - - run: | + - name: Build storybook + env: + STORYBOOK_SCREENSHOT_TEST_BUILD: true + CHROMATIC_DIFF_THRESHOLD: ${{ secrets.CHROMATIC_DIFF_THRESHOLD }} + run: | npm install npm --workspace="packages/calcite-design-tokens" run build npm --workspace="packages/calcite-ui-icons" run build + npm --workspace="packages/calcite-components" run build-storybook - name: Publish to Chromatic + if: | + (github.event.action == 'labeled' && github.event.label.name == 'pr ready for visual snapshots') || github.event_name == 'push' uses: chromaui/action@v11 with: projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} @@ -29,6 +34,7 @@ jobs: exitOnceUploaded: true autoAcceptChanges: ${{ github.base_ref || github.ref_name }} workingDir: packages/calcite-components + storybookBuildDir: docs env: STORYBOOK_SCREENSHOT_TEST_BUILD: true CHROMATIC_DIFF_THRESHOLD: ${{ secrets.CHROMATIC_DIFF_THRESHOLD }}