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: Add Chromatic publishing to superset-frontend storybook #21095

Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
b428627
Work in progress to add Chromatic publishing to superset-fronted stor…
eric-briscoe Aug 15, 2022
809a919
Adjust Chromatic Github action
eric-briscoe Aug 15, 2022
b9e5173
Adjust action so Gtihub Secret is read into env
eric-briscoe Aug 15, 2022
a80e20e
Removes unneccesary projectToken from package json
eric-briscoe Aug 15, 2022
0d405e5
Using a temp key to debug no access to value from github secret
eric-briscoe Aug 15, 2022
914d9f5
Refining skipping if no changes to superset-frontend
eric-briscoe Aug 15, 2022
7be5bc8
Remove typos from Action component story, consolidate on folder check…
eric-briscoe Aug 15, 2022
474d5f9
Fix error in Chromatic action event
eric-briscoe Aug 15, 2022
313afa4
Testing action with pul_request_target
eric-briscoe Aug 16, 2022
36a57b0
adjustments to Chromatic action triggers
eric-briscoe Aug 16, 2022
a5eaeaf
lint fix
eric-briscoe Aug 17, 2022
780b061
Testing if pull_request_target is disabled
eric-briscoe Aug 17, 2022
f5f2d47
More adjustments to Chromatic action
eric-briscoe Aug 17, 2022
4e5cef3
UI Change to trigger action
eric-briscoe Aug 17, 2022
67233a6
Change to story text to test action
eric-briscoe Aug 18, 2022
ca2b7ab
Merge branch 'master' into ericbriscoe/sc-51041/connect-storybook-to-…
eric-briscoe Aug 18, 2022
d3408ce
update package-lock after merge conflicts from master
eric-briscoe Aug 18, 2022
2c9eb27
Changes to test chromatic action
eric-briscoe Aug 18, 2022
1c82463
Merge branch 'master' into ericbriscoe/sc-51041/connect-storybook-to-…
eric-briscoe Aug 18, 2022
cd621b9
Merge branch 'master' into ericbriscoe/sc-51041/connect-storybook-to-…
eric-briscoe Aug 22, 2022
cf02934
Merge branch 'master' into ericbriscoe/sc-51041/connect-storybook-to-…
eric-briscoe Aug 22, 2022
d52c4a5
Finalize Chromatic actions, fix lint errors
eric-briscoe Aug 23, 2022
96b2703
Backs out addition of @storybook/addon-docs which is included in addo…
eric-briscoe Aug 23, 2022
bc466ed
Lint error in package.json
eric-briscoe Aug 23, 2022
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
56 changes: 56 additions & 0 deletions .github/workflows/chromatic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# .github/workflows/chromatic.yml
# seee https://www.chromatic.com/docs/github-actions

# Workflow name
name: 'Chromatic'

# Event for the workflow
# Only run if changes were made in superset-frontend folder of repo
on:
push:
branches:
- master
paths:
- "superset-frontend/**"
pull_request_target:
types: [opened, edited, synchronize, reopen]
paths:
- "superset-frontend/**"

env:
CHROMATIC_PROJECT_TOKEN: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
eschutho marked this conversation as resolved.
Show resolved Hide resolved

# List of jobs
jobs:
chromatic-deployment:
# Operating System
runs-on: ubuntu-latest
# Job steps
steps:
- uses: actions/checkout@v1
- name: Install dependencies
run: npm ci
working-directory: superset-frontend
# 👇 Checks if the branch is not master and runs Chromatic
- name: Publish to Chromatic
if: github.ref != 'refs/heads/master'
uses: chromaui/action@v1
# Required options for the Chromatic GitHub Action
with:
# 👇 Location of package.json from root of mono-repo
workingDir: superset-frontend
# 👇 Chromatic projectToken, refer to the manage page to obtain it.
projectToken: ${{ env.CHROMATIC_PROJECT_TOKEN }}
eschutho marked this conversation as resolved.
Show resolved Hide resolved
exitZeroOnChanges: true # 👈 Option to prevent the workflow from failing
# 👇 Checks if the branch is master and accepts all changes in Chromatic
- name: Publish to Chromatic and auto accept changes
if: github.ref == 'refs/heads/master'
uses: chromaui/action@v1
# Required options for the Chromatic GitHub Action
with:
# 👇 Location of package.json from root of mono-repo
workingDir: superset-frontend
# 👇 Chromatic projectToken, refer to the manage page to obtain it.
projectToken: ${{ env.CHROMATIC_PROJECT_TOKEN }}
eschutho marked this conversation as resolved.
Show resolved Hide resolved
autoAcceptChanges: true # 👈 Option to accept all changes when merging to master
exitZeroOnChanges: true # 👈 Option to prevent the workflow from failing
4 changes: 2 additions & 2 deletions superset-frontend/.storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module.exports = {
builder: 'webpack5',
},
stories: [
'../src/@(components|common|filters|explore)/**/*.stories.@(t|j)sx',
'../src/@(components|common|filters|explore)/**/*.stories.@(tsx|jsx|mdx)',
],
addons: [
'@storybook/addon-essentials',
Expand All @@ -47,6 +47,6 @@ module.exports = {
plugins: [...config.plugins, ...customConfig.plugins],
}),
typescript: {
reactDocgen: 'none',
reactDocgen: 'react-docgen-typescript',
},
};
9 changes: 8 additions & 1 deletion superset-frontend/.storybook/preview.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,14 @@ addParameters({
},
options: {
storySort: {
method: 'alphabetical',
order: [
'Superset Frontend',
['Controls', 'Display', 'Feedback', 'Input', '*'],
['Overview', 'Examples', '*'],
'Design System',
['Foundations', 'Components', 'Patterns', '*'],
'*',
],
},
},
});
Loading