File tree Expand file tree Collapse file tree 2 files changed +63
-0
lines changed
Expand file tree Collapse file tree 2 files changed +63
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Chromatic
2+ description : Publish Storybook, run visual regression tests and setup snapshot baselines for
3+ the following tests.
4+
5+ inputs :
6+ chromatic-project-token :
7+ description : Chromatic project token
8+ required : true
9+
10+ runs :
11+ using : composite
12+ steps :
13+ - uses : actions/checkout@v4
14+ with :
15+ fetch-depth : 0 # Pull more than just last commit for Chromatic to run it's git-based diffing
16+ - uses : ./.github/actions/setup-project
17+
18+ - name : Publish Storybook and run visual regression tests
19+ env :
20+ NODE_OPTIONS : " --max_old_space_size=4096"
21+ uses : chromaui/action@v1
22+ with :
23+ projectToken : ${{ inputs.chromatic-project-token }}
24+ exitZeroOnChanges : true
25+ onlyChanged : true
Original file line number Diff line number Diff line change 1+ name : Chromatic
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+ workflow_dispatch :
8+
9+ env :
10+ NODE_OPTIONS : --max-old-space-size=16384
11+
12+ jobs :
13+ install : # Warm up node_modules cache for the following jobs
14+ name : Set up Node.js and install npm dependencies
15+ runs-on : ubuntu-22.04
16+ steps :
17+ - uses : actions/checkout@v4
18+ - uses : ./.github/actions/setup-project
19+ # with:
20+ # NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
21+
22+ storybook :
23+ name : Chromatic toolset initialization
24+ needs : [install]
25+ runs-on : ubuntu-22.04
26+ environment : dev
27+ steps :
28+ - uses : actions/checkout@v4
29+ - name : Export variables
30+ env :
31+ VARS_CONTEXT : ${{ toJson(vars) }}
32+ run : |
33+ EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
34+ to_envs() { jq -r "to_entries[] | select(.key|startswith(\"PUBLIC_VAR\")) | \"\(.key)<<$EOF\n\(.value)\n$EOF\n\""; }
35+ echo "$VARS_CONTEXT" | to_envs >> $GITHUB_ENV
36+ - uses : ./.github/actions/chromatic
37+ with :
38+ chromatic-project-token : ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
You can’t perform that action at this time.
0 commit comments