Skip to content
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

[Visual Testing] Chromatic - Initial Github action integration #29

Merged
merged 4 commits into from
Jul 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/chromatic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: 'Test'

on: pull_request

jobs:
Visual-Regression:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install compatible node version
uses: actions/setup-node@v3
with:
node-version: '16'

- name: Install dependencies
run: yarn

- name: Publish to Chromatic
uses: chromaui/action@v1
with:
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
onlyChanged: true # Enables https://www.chromatic.com/docs/turbosnap
exitZeroOnChanges: true # Visual changes SHOULD NOT block merging of PRs
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ node_modules
dist
dist-storybook
*.local
*.log
.eslintcache
coverage
.nyc_output
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
"validate": "run-p lint test:ci test:e2e:headless",
"start": "yarn storybook",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build -o dist-storybook"
"build-storybook": "storybook build -o dist-storybook",
"chromatic": "chromatic --storybook-build-dir dist-storybook --only-changed"
},
"dependencies": {
"@cfpb/cfpb-design-system": "^0.27.2",
Expand Down Expand Up @@ -83,6 +84,7 @@
"@vitest/coverage-istanbul": "0.25.2",
"autoprefixer": "10.4.13",
"babel-loader": "^8.3.0",
"chromatic": "^6.19.9",
"commitizen": "4.2.5",
"css-mediaquery": "0.1.2",
"cypress": "10.11.0",
Expand Down
27 changes: 0 additions & 27 deletions src/pages/Page.stories.tsx

This file was deleted.

74 changes: 0 additions & 74 deletions src/pages/Page.tsx

This file was deleted.

69 changes: 0 additions & 69 deletions src/pages/page.css

This file was deleted.

5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4684,6 +4684,11 @@ chownr@^2.0.0:
resolved "https://registry.yarnpkg.com/chownr/-/chownr-2.0.0.tgz#15bfbe53d2eab4cf70f18a8cd68ebe5b3cb1dece"
integrity sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==

chromatic@^6.19.9:
version "6.19.9"
resolved "https://registry.yarnpkg.com/chromatic/-/chromatic-6.19.9.tgz#b73548ad31154f3ac5e1291268ee44e4778e3057"
integrity sha512-UHrPbPoLnJwd063cRSO0U865VhcATykpMiHsAnNFz5EFRsBvM9wefqyS2Z6W8Ti9J7Fjrf4MV4PA+Q5k2lhFfQ==

ci-info@^3.2.0, ci-info@^3.6.1:
version "3.8.0"
resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.8.0.tgz#81408265a5380c929f0bc665d62256628ce9ef91"
Expand Down