Skip to content

Commit

Permalink
ci(chromatic): build storybook even when skipping snapshots (#10589)
Browse files Browse the repository at this point in the history
## 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.
  • Loading branch information
benelan authored Oct 24, 2024
1 parent 63abe83 commit 2965477
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/chromatic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -17,18 +15,26 @@ 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 }}
zip: true
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 }}
Expand Down

0 comments on commit 2965477

Please sign in to comment.