- Notifications
You must be signed in to change notification settings - Fork1k
chore: configure chromatic snapshot tests#896
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
4 commits Select commitHold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
51 changes: 51 additions & 0 deletions.github/workflows/chromatic.yaml
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,51 @@ | ||
# Note: Chromatic is a separate workflow for coder.yaml as suggested by the | ||
# chromatic docs. Explicitly, Chromatic works best on 'push' instead of other | ||
# event types (like pull request), keep in mind that it works build-over-build | ||
# by storing snapshots. | ||
# | ||
# SEE: https://www.chromatic.com/docs/ci | ||
name: "Chromatic" | ||
# Chromatic works best with push events, not pull_request or other event types. | ||
on: push | ||
jobs: | ||
chromatic-deployment: | ||
# REMARK: this is only used to build storybook and deploy it to Chromatic. | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
# Required by Chromatic for build-over-build history, otherwise we | ||
# only get 1 commit on shallow checkout. | ||
fetch-depth: 0 | ||
- name: Install dependencies | ||
run: cd site && yarn | ||
# This step is not meant for mainline because any detected changes to | ||
# storybook snapshots will require manual approval/review in order for | ||
# the check to pass. This is desired in PRs, but not in mainline. | ||
- name: Publish to Chromatic (non-mainline) | ||
if: github.ref != 'refs/heads/main' | ||
uses: chromaui/action@v1 | ||
with: | ||
buildScriptName: "storybook:build" | ||
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} | ||
workingDir: "./site" | ||
# This is a separate step for mainline only that auto accepts and changes | ||
# instead of holding CI up. Since we squash/merge, this is defensive to | ||
# avoid the same changeset from requiring review once squashed into | ||
# main. Chromatic is supposed to be able to detect that we use squash | ||
# commits, but it's good to be defensive in case, otherwise CI remains | ||
# infinitely "in progress" in mainline unless we re-review each build. | ||
- name: Publish to Chromatic (mainline) | ||
if: github.ref == 'refs/heads/main' | ||
uses: chromaui/action@v1 | ||
with: | ||
autoAcceptChanges: true | ||
buildScriptName: "storybook:build" | ||
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} | ||
workingDir: "./site" |
4 changes: 0 additions & 4 deletions.github/workflows/coder.yaml
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 |
---|---|---|
@@ -387,10 +387,6 @@ jobs: | ||
run:yarn build | ||
working-directory:site | ||
-run:yarn test:coverage | ||
working-directory:site | ||
1 change: 1 addition & 0 deletions.gitignore
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 |
---|---|---|
@@ -25,6 +25,7 @@ site/test-results/ | ||
site/yarn-error.log | ||
coverage/ | ||
site/**/*.typegen.ts | ||
site/build-storybook.log | ||
# Build | ||
dist/ | ||
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
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.