-
Notifications
You must be signed in to change notification settings - Fork 1
ci: add Chromatic workflow and clarify release cadence #737
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
QuintonJason
wants to merge
6
commits into
main
Choose a base branch
from
ci/add-chromatic
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
971b36b
ci: add Chromatic workflow and clarify release cadence
QuintonJason d892352
ci(chromatic): set exitZeroOnChanges and autoAcceptChanges policy
QuintonJason 44609fd
ci(chromatic): skip workflow when project token is not configured
QuintonJason fe44c28
ci(chromatic): pin action to SHA and bump checkout to v6
QuintonJason 3c4ba46
ci(chromatic): address Bugbot feedback on checkout, npm, and auto-accept
QuintonJason 119d545
ci(chromatic): fix secret gate and autoAcceptChanges branch glob
QuintonJason File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| name: Chromatic | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main, next] | ||
| pull_request: | ||
| branches: [main, next] | ||
|
|
||
| concurrency: | ||
| group: chromatic-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| publish: | ||
| runs-on: ubuntu-latest | ||
| # Fork PRs cannot use repository secrets. | ||
| if: >- | ||
| github.event_name != 'pull_request' || | ||
| github.event.pull_request.head.repo.full_name == github.repository | ||
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
| steps: | ||
| - name: Check Chromatic token is configured | ||
| id: chromatic-token | ||
| env: | ||
| CHROMATIC_PROJECT_TOKEN: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} | ||
| run: | | ||
| if [ -n "$CHROMATIC_PROJECT_TOKEN" ]; then | ||
| echo "configured=true" >> "$GITHUB_OUTPUT" | ||
| else | ||
| echo "configured=false" >> "$GITHUB_OUTPUT" | ||
| echo "CHROMATIC_PROJECT_TOKEN is not configured; skipping Chromatic publish." | ||
| fi | ||
|
|
||
| - name: Check out latest | ||
| if: steps.chromatic-token.outputs.configured == 'true' | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| fetch-depth: 0 | ||
| ref: ${{ github.event.pull_request.head.sha }} | ||
|
|
||
| - name: Set up Node.js (pinned npm) | ||
| if: steps.chromatic-token.outputs.configured == 'true' | ||
| uses: ./.github/workflows/actions/setup-node-with-pinned-npm | ||
| with: | ||
| node-version-file: '.nvmrc' | ||
|
|
||
| - name: Install dependencies | ||
| if: steps.chromatic-token.outputs.configured == 'true' | ||
| run: npm ci | ||
|
cursor[bot] marked this conversation as resolved.
|
||
|
|
||
| - name: Build doc components | ||
| if: steps.chromatic-token.outputs.configured == 'true' | ||
| run: npx nx run @pine-ds/doc-components:build | ||
|
|
||
| - name: Build Stencil (Storybook consumes dist) | ||
| if: steps.chromatic-token.outputs.configured == 'true' | ||
| run: npx nx run @pine-ds/core:build | ||
|
|
||
| - name: Build Storybook static | ||
| if: steps.chromatic-token.outputs.configured == 'true' | ||
| run: npx nx run @pine-ds/core:build.storybook | ||
|
|
||
| - name: Publish to Chromatic | ||
| if: steps.chromatic-token.outputs.configured == 'true' | ||
| # Pin to full SHA (v16.9.1) for supply-chain security | ||
| uses: chromaui/action@c231f99a49d72bfcf68eca3f1ef3187f471e352b | ||
| with: | ||
| projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} | ||
| workingDir: libs/core | ||
| storybookBuildDir: storybook-static | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
| # PRs: do not fail the workflow on visual changes — Chromatic | ||
| # posts its own PR status check that blocks merge when changes | ||
| # are unapproved. This keeps the workflow itself green so other | ||
| # required checks can render their state independently. | ||
| exitZeroOnChanges: true | ||
| # Main and next: accept visual diffs into the baseline automatically. | ||
| # By the time something is on main or next it has been reviewed, so | ||
| # re-approving in Chromatic adds friction without catching anything new. | ||
| autoAcceptChanges: '@(main|next)' | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.