-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Check Storybook build on CI for PRs #68466
base: trunk
Are you sure you want to change the base?
Conversation
Size Change: -18 B (0%) Total Size: 1.84 MB
ℹ️ View Unchanged
|
uses: ./.github/setup-node | ||
|
||
- name: Build Storybook | ||
run: npm run storybook:build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 does it make sense to run the regular build command here though? We don't really need the built assets, right?
There's a --smoke-test
feature we could use for this purpose:
Furthermore, for such purposes, we should likely utilize --ci
, which skips any interactive prompts:
I'd suggest we introduce a new smoke test command and we use it here.
Its package.json script entry would look roughly like this (untested):
"storybook:smoke-test": "storybook dev -c ./storybook --ci --smoke-test"
WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw this in the original PR but leaned toward build
for a couple reasons:
- What we most want to prevent is the public Storybook workflow failing on trunk. There is a chance that the dev build succeeds but the prod build doesn't.
- At least when running
time
comparisons locally, there is no substantial wall-clock difference betweendev --ci --smoke-test
andbuild
, even though the total CPU time is clearly different (apparentlybuild
is better parallelized). The only significant difference was in the failing case, wheredev --ci --smoke-test
was actually 1 minute slower in wall-clock time due to some weird hanging between the error being logged and the process exiting. - Using
dev
requires a new test command (and possibly an additionalpre
command) in package.json.
So all in all it seems to me like using build
is simpler and good enough, but no strong opinion. Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a chance that the dev build succeeds but the prod build doesn't.
Could you elaborate on that? Under what circumstances would it happen?
What's more important is that it's surprising that the smoke test is slower! In my tests against v7 (in another repo, though), that wasn't the case. If the regular build command is faster, I don't see a good reason not to go with it 👍
Flaky tests detected in e3ed320. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/12584968343
|
What?
Adds a CI check on PRs to ensure that the Storybook builds without errors.
Why?
To prevent Storybook-breaking changes (like #68419 (comment)) from being merged into trunk.
Testing Instructions
✅ The CI check passes on a working build (4c12233)
✅ The CI check fails on a broken build (fdf8121)