From 8c598230a23464cf8574787f8b551fbbc798b3b3 Mon Sep 17 00:00:00 2001 From: Ben Elan Date: Tue, 22 Oct 2024 22:33:38 -0700 Subject: [PATCH 1/3] ci(chormatic): build storybook even when skipping snapshots --- .github/workflows/chromatic.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/chromatic.yml b/.github/workflows/chromatic.yml index e5eed78c099..61e2041f08b 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 @@ -21,7 +19,10 @@ jobs: 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 +30,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 }} From a723cde041faf4695006928399e22dcac8ad69a9 Mon Sep 17 00:00:00 2001 From: Ben Elan Date: Tue, 22 Oct 2024 23:12:10 -0700 Subject: [PATCH 2/3] chore: cleanup --- .github/workflows/chromatic.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/chromatic.yml b/.github/workflows/chromatic.yml index 61e2041f08b..013ac81e389 100644 --- a/.github/workflows/chromatic.yml +++ b/.github/workflows/chromatic.yml @@ -15,7 +15,8 @@ jobs: - uses: actions/setup-node@v4 with: node-version-file: package.json - - run: | + - name: Build storybook + run: | npm install npm --workspace="packages/calcite-design-tokens" run build npm --workspace="packages/calcite-ui-icons" run build From 167fa1f916fb97f7068838c42a5d7d7013d52150 Mon Sep 17 00:00:00 2001 From: Ben Elan Date: Wed, 23 Oct 2024 16:29:53 -0700 Subject: [PATCH 3/3] chore: set environment variables --- .github/workflows/chromatic.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/chromatic.yml b/.github/workflows/chromatic.yml index 013ac81e389..7eabddaa911 100644 --- a/.github/workflows/chromatic.yml +++ b/.github/workflows/chromatic.yml @@ -16,6 +16,9 @@ jobs: with: node-version-file: package.json - 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