Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Commit b2b134e

Browse files
authored
ci: enable chromatic again (#61197)
1 parent 432f328 commit b2b134e

File tree

3 files changed

+2447
-2133
lines changed

3 files changed

+2447
-2133
lines changed

dev/ci/internal/ci/client_operations.go

+26-26
Original file line numberDiff line numberDiff line change
@@ -65,33 +65,33 @@ func recordBrowserExtensionIntegrationTests(pipeline *bk.Pipeline) {
6565

6666
func clientChromaticTests(opts CoreTestOperationsOptions) operations.Operation {
6767
return func(pipeline *bk.Pipeline) {
68-
// stepOpts := []bk.StepOpt{
69-
// withPnpmCache(),
70-
// bk.AutomaticRetry(3),
71-
// bk.Cmd("./dev/ci/pnpm-install-with-retry.sh"),
72-
// bk.Cmd("pnpm run generate"),
73-
// bk.Env("MINIFY", "1"),
74-
// }
75-
//
76-
// // Upload storybook to Chromatic
77-
// //
78-
// // We run chromatic through `run-chromatic` because the script detects whether a build is being retried
79-
// // and then adds the flag `--force-rebuild`. We need to do this because Chromatic fails when running on
80-
// // the same commit.
81-
// chromaticCommand := "./dev/ci/run-chromatic.sh --exit-zero-on-changes --exit-once-uploaded"
82-
// if opts.ChromaticShouldAutoAccept {
83-
// // have to specify a value. Value can either be a branch glob or a boolean
84-
// // see https://www.chromatic.com/docs/cli/
85-
// chromaticCommand += " --auto-accept-changes true"
86-
// } else {
87-
// // Unless we plan on automatically accepting these changes, we only run this
88-
// // step on ready-for-review pull requests.
89-
// stepOpts = append(stepOpts, bk.IfReadyForReview(opts.ForceReadyForReview))
90-
// chromaticCommand += " | ./dev/ci/post-chromatic.sh"
91-
// }
68+
stepOpts := []bk.StepOpt{
69+
withPnpmCache(),
70+
bk.AutomaticRetry(3),
71+
bk.Cmd("./dev/ci/pnpm-install-with-retry.sh"),
72+
bk.Cmd("pnpm run generate"),
73+
bk.Env("MINIFY", "1"),
74+
}
75+
76+
// Upload storybook to Chromatic
9277
//
93-
// pipeline.AddStep(":chromatic: Upload Storybook to Chromatic",
94-
// append(stepOpts, bk.Cmd(chromaticCommand))...)
78+
// We run chromatic through `run-chromatic` because the script detects whether a build is being retried
79+
// and then adds the flag `--force-rebuild`. We need to do this because Chromatic fails when running on
80+
// the same commit.
81+
chromaticCommand := "./dev/ci/run-chromatic.sh --exit-zero-on-changes --exit-once-uploaded"
82+
if opts.ChromaticShouldAutoAccept {
83+
// have to specify a value. Value can either be a branch glob or a boolean
84+
// see https://www.chromatic.com/docs/cli/
85+
chromaticCommand += " --auto-accept-changes true"
86+
} else {
87+
// Unless we plan on automatically accepting these changes, we only run this
88+
// step on ready-for-review pull requests.
89+
stepOpts = append(stepOpts, bk.IfReadyForReview(opts.ForceReadyForReview))
90+
chromaticCommand += " | ./dev/ci/post-chromatic.sh"
91+
}
92+
93+
pipeline.AddStep(":chromatic: Upload Storybook to Chromatic",
94+
append(stepOpts, bk.Cmd(chromaticCommand))...)
9595
}
9696
}
9797

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@
180180
"bundlesize2": "^0.0.31",
181181
"chalk": "^4.1.0",
182182
"chokidar-cli": "^2.1.0",
183-
"chromatic": "^10.1.0",
183+
"chromatic": "^11.0.8",
184184
"chrome-webstore-upload-cli": "^1.2.0",
185185
"command-exists": "^1.2.9",
186186
"compression": "^1.7.4",
@@ -252,7 +252,7 @@
252252
"term-size": "^2.2.0",
253253
"text-table": "^0.2.0",
254254
"ts-dedent": "^2.2.0",
255-
"ts-node": "^10.7.0",
255+
"ts-node": "^10.9.2",
256256
"typed-scss-modules": "^4.1.1",
257257
"typescript": "^5.0.2",
258258
"utc-version": "^2.0.2",

0 commit comments

Comments
 (0)