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

feat(docs): implement storybook setup with chromatic visual tests #811

Merged
merged 12 commits into from
Aug 24, 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
39 changes: 39 additions & 0 deletions .github/workflows/chromatic-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Chromatic for Docs
# All pull requests, and
# Workflow dispatch allows you to run this workflow manually from the Actions tab
on:
push:
paths:
- packages/apps/docs/**

jobs:
chromatic:
name: Visual Regression Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # 👈 Required to retrieve git history, needed to determine diffs.

- uses: actions/setup-node@v3
with:
node-version: 18

- name: Rush install (install-run-rush)
run: |
node common/scripts/install-run-rush.js install -t @kadena/docs

- name: Rush Build (internal dependencies)
run: |
node common/scripts/install-run-rush.js build -t @kadena/react-ui
node common/scripts/install-run-rush.js build -t @kadena/react-components

- name: Publish Storybook
uses: chromaui/action@v1
with:
# 👇 Chromatic projectToken, refer to the manage page to obtain it.
exitOnceUploaded: true
buildScriptName: 'build:storybook'
projectToken: ${{ secrets.DOCS_CHROMATIC_TOKEN }}
workingDir: /packages/apps/docs
autoAcceptChanges: 'main'
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Chromatic
name: Chromatic for react ui
# All pull requests, and
# Workflow dispatch allows you to run this workflow manually from the Actions tab
on:
Expand Down Expand Up @@ -27,7 +27,7 @@ jobs:
with:
# 👇 Chromatic projectToken, refer to the manage page to obtain it.
exitOnceUploaded: true
buildScriptName: "build:storybook"
buildScriptName: 'build:storybook'
projectToken: ${{ secrets.REACT_UI_CHROMATIC_TOKEN }}
workingDir: /packages/libs/react-ui
autoAcceptChanges: 'main'
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,6 @@ packages/*/*/temp
# Intelij idea files
.idea
.idea/*

# Storybook static build
storybook-static
Loading