13
13
- opened
14
14
- reopened
15
15
- synchronize
16
- # - ready_for_review relevant for chromatic, at some point
16
+ - ready_for_review
17
17
workflow_dispatch :
18
18
19
19
concurrency :
35
35
- name : Build Storybook docs
36
36
run : |
37
37
npm ci
38
+ npm run compilemessages
38
39
npm run build-storybook --quiet
39
40
40
41
- name : Upload artifact
58
59
59
60
- name : Build library
60
61
run : |
62
+ npm run compilemessages
61
63
npm run build:typecheck
62
64
npm run build
63
65
97
99
cache : npm
98
100
99
101
- name : Install dependencies
100
- run : npm install
102
+ run : npm ci
101
103
102
104
- name : Run tests
103
105
run : |
@@ -117,12 +119,13 @@ jobs:
117
119
cache : npm
118
120
119
121
- name : Install dependencies
120
- run : npm install
122
+ run : npm ci
121
123
122
124
# Reference: https://storybook.js.org/docs/6.5/react/writing-tests/test-runner#run-against-non-deployed-storybooks
123
125
- name : Set up test environment
124
126
run : |
125
127
npx playwright install --with-deps
128
+ npm run compilemessages
126
129
127
130
- name : Download storybook artifact
128
131
uses : actions/download-artifact@v4
@@ -165,6 +168,43 @@ jobs:
165
168
id : deployment
166
169
uses : actions/deploy-pages@v4
167
170
171
+ chromatic :
172
+ name : Visual regression test with Chromatic
173
+ runs-on : ubuntu-latest
174
+ needs :
175
+ - storybook
176
+
177
+ # do not run in forks
178
+ if : github.event_name == 'push' || ! github.event.pull_request.head.repo.fork
179
+
180
+ steps :
181
+ - name : Checkout repository
182
+ uses : actions/checkout@v4
183
+ with :
184
+ fetch-depth : 0 # 👈 Required to retrieve git history
185
+
186
+ - name : Download build artifact
187
+ uses : actions/download-artifact@v4
188
+ with :
189
+ name : github-pages
190
+ path : ./storybook-static
191
+
192
+ - name : Extract artifact
193
+ run : |
194
+ tar -xvf artifact.tar
195
+ rm artifact.tar
196
+ working-directory : ./storybook-static
197
+
198
+ - name : Publish to Chromatic for visual regression tests
199
+ uses : chromaui/action@latest
200
+ if : github.event.pull_request.draft == false || github.event.push
201
+ with :
202
+ autoAcceptChanges : main
203
+ projectToken : ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
204
+ storybookBuildDir : ./storybook-static
205
+ onlyChanged : true
206
+ externals : ' src/img/**'
207
+
168
208
publish :
169
209
name : Publish the NPM package
170
210
runs-on : ubuntu-latest
0 commit comments