Repository navigation
ci: optimize PR workflow — deduplicate build, shallow clones - #1379
Merged
Merged
Conversation
- Remove duplicate `yarn build` + `verify-exports` from test job (already runs in build job). Saves ~1 min on the test critical path. - Move typecheck steps (component docs, template docs) into build job where the build output already exists. - Replace fetch-depth: 0 with shallow checkout + targeted base fetch in both build and check-components jobs. Only fetches what's needed for git diff analysis (~40s → ~2s). Co-authored-by: Navi <[email protected]>
Contributor
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR No new or modified components detected. Bundle Size Summary
Accessibility AuditStatus: No accessibility violations detected. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
Split the monolithic build job into a pipeline:
build (core) → build-storybook + build-sandbox (parallel) → deploy
Before: build job ran core → Storybook → Sandbox serially (6m27s)
After: core build (~2m) uploads dist artifact, then Storybook (~1m)
and Sandbox (~3m) build in parallel on separate runners.
The critical path to PR deploy drops from ~6.5min to ~5min since
Sandbox (3min) and Storybook (1min) now overlap instead of stacking.
PR comment still fires immediately after core build (no wait for
Storybook/Sandbox), so analysis feedback arrives even earlier.
Co-authored-by: Navi <[email protected]>
The artifact sharing approach didn't work — upload-artifact strips directory prefixes, so dist/ files landed at the wrong paths. Instead, each parallel job (build-storybook, build-sandbox) runs yarn build (~1m) locally. Still wins time from parallelism since Sandbox (3m) and Storybook (1m) overlap. Co-authored-by: Navi <[email protected]>
The parallel Storybook/Sandbox split added runner overhead that ate the parallelism gain. Reverted to single build job. Kept the wins that actually help: - Removed duplicate yarn build from test job (~1m saved) - Moved typechecks into build job (where build output exists) - Shallow clones in build + check-components (~40s saved) Co-authored-by: Navi <[email protected]>
cixzhang
added a commit
that referenced
this pull request
Apr 26, 2026
…1379) * ci: optimize PR workflow — deduplicate build, shallow clones - Remove duplicate `yarn build` + `verify-exports` from test job (already runs in build job). Saves ~1 min on the test critical path. - Move typecheck steps (component docs, template docs) into build job where the build output already exists. - Replace fetch-depth: 0 with shallow checkout + targeted base fetch in both build and check-components jobs. Only fetches what's needed for git diff analysis (~40s → ~2s). Co-authored-by: Navi <[email protected]> * ci: parallelize Storybook + Sandbox builds for faster PR deploy Split the monolithic build job into a pipeline: build (core) → build-storybook + build-sandbox (parallel) → deploy Before: build job ran core → Storybook → Sandbox serially (6m27s) After: core build (~2m) uploads dist artifact, then Storybook (~1m) and Sandbox (~3m) build in parallel on separate runners. The critical path to PR deploy drops from ~6.5min to ~5min since Sandbox (3min) and Storybook (1min) now overlap instead of stacking. PR comment still fires immediately after core build (no wait for Storybook/Sandbox), so analysis feedback arrives even earlier. Co-authored-by: Navi <[email protected]> * fix: build core locally in each parallel job The artifact sharing approach didn't work — upload-artifact strips directory prefixes, so dist/ files landed at the wrong paths. Instead, each parallel job (build-storybook, build-sandbox) runs yarn build (~1m) locally. Still wins time from parallelism since Sandbox (3m) and Storybook (1m) overlap. Co-authored-by: Navi <[email protected]> * ci: revert parallel split, keep dedup + shallow clones The parallel Storybook/Sandbox split added runner overhead that ate the parallelism gain. Reverted to single build job. Kept the wins that actually help: - Removed duplicate yarn build from test job (~1m saved) - Moved typechecks into build job (where build output exists) - Shallow clones in build + check-components (~40s saved) Co-authored-by: Navi <[email protected]> --------- Co-authored-by: Navi <[email protected]>
cixzhang
added a commit
that referenced
this pull request
Jun 21, 2026
…1379) * ci: optimize PR workflow — deduplicate build, shallow clones - Remove duplicate `yarn build` + `verify-exports` from test job (already runs in build job). Saves ~1 min on the test critical path. - Move typecheck steps (component docs, template docs) into build job where the build output already exists. - Replace fetch-depth: 0 with shallow checkout + targeted base fetch in both build and check-components jobs. Only fetches what's needed for git diff analysis (~40s → ~2s). Co-authored-by: Navi <[email protected]> * ci: parallelize Storybook + Sandbox builds for faster PR deploy Split the monolithic build job into a pipeline: build (core) → build-storybook + build-sandbox (parallel) → deploy Before: build job ran core → Storybook → Sandbox serially (6m27s) After: core build (~2m) uploads dist artifact, then Storybook (~1m) and Sandbox (~3m) build in parallel on separate runners. The critical path to PR deploy drops from ~6.5min to ~5min since Sandbox (3min) and Storybook (1min) now overlap instead of stacking. PR comment still fires immediately after core build (no wait for Storybook/Sandbox), so analysis feedback arrives even earlier. Co-authored-by: Navi <[email protected]> * fix: build core locally in each parallel job The artifact sharing approach didn't work — upload-artifact strips directory prefixes, so dist/ files landed at the wrong paths. Instead, each parallel job (build-storybook, build-sandbox) runs yarn build (~1m) locally. Still wins time from parallelism since Sandbox (3m) and Storybook (1m) overlap. Co-authored-by: Navi <[email protected]> * ci: revert parallel split, keep dedup + shallow clones The parallel Storybook/Sandbox split added runner overhead that ate the parallelism gain. Reverted to single build job. Kept the wins that actually help: - Removed duplicate yarn build from test job (~1m saved) - Moved typechecks into build job (where build output exists) - Shallow clones in build + check-components (~40s saved) Co-authored-by: Navi <[email protected]> --------- Co-authored-by: Navi <[email protected]>
cixzhang
added a commit
that referenced
this pull request
Jun 21, 2026
…1379) * ci: optimize PR workflow — deduplicate build, shallow clones - Remove duplicate `yarn build` + `verify-exports` from test job (already runs in build job). Saves ~1 min on the test critical path. - Move typecheck steps (component docs, template docs) into build job where the build output already exists. - Replace fetch-depth: 0 with shallow checkout + targeted base fetch in both build and check-components jobs. Only fetches what's needed for git diff analysis (~40s → ~2s). * ci: parallelize Storybook + Sandbox builds for faster PR deploy Split the monolithic build job into a pipeline: build (core) → build-storybook + build-sandbox (parallel) → deploy Before: build job ran core → Storybook → Sandbox serially (6m27s) After: core build (~2m) uploads dist artifact, then Storybook (~1m) and Sandbox (~3m) build in parallel on separate runners. The critical path to PR deploy drops from ~6.5min to ~5min since Sandbox (3min) and Storybook (1min) now overlap instead of stacking. PR comment still fires immediately after core build (no wait for Storybook/Sandbox), so analysis feedback arrives even earlier. * fix: build core locally in each parallel job The artifact sharing approach didn't work — upload-artifact strips directory prefixes, so dist/ files landed at the wrong paths. Instead, each parallel job (build-storybook, build-sandbox) runs yarn build (~1m) locally. Still wins time from parallelism since Sandbox (3m) and Storybook (1m) overlap. * ci: revert parallel split, keep dedup + shallow clones The parallel Storybook/Sandbox split added runner overhead that ate the parallelism gain. Reverted to single build job. Kept the wins that actually help: - Removed duplicate yarn build from test job (~1m saved) - Moved typechecks into build job (where build output exists) - Shallow clones in build + check-components (~40s saved) ---------
6 tasks done
cixzhang
pushed a commit
that referenced
this pull request
Jul 19, 2026
…nes (#3865) The shallow-clone optimization in #1379 (5cf9420) set the default fetch-depth of 1 on the check-components and build jobs while their change detection still uses three-dot diffs (origin/main...HEAD), which require the merge base to exist locally. On a depth-1 clone the diff fails with "fatal: no merge base" and both consumers swallowed it: - check-components: the failed diff piped through grep/head yields an empty string, so has_components=false and pr-a11y is silently skipped on every PR. - build: analyze-pr.js caught the error and returned [], so the PR Analysis Report always posted "New components: none / Modified components: none". Fix, following the depth-50 pattern already proven by check-scope in the same file: - check-components + build: fetch-depth: 50 on checkout and --depth=50 on the base fetch. - check-components: explicit merge-base guard that fails open (has_components=true, with a ::warning) instead of silently skipping the a11y audit if the clone is ever too shallow again. - analyze-pr.js: a failed diff now exits non-zero with ::error instead of being reported as "no changes". Verified with a local bare-repo simulation replicating the actions/checkout fetch pattern: depth 1 reproduces "fatal: no merge base" -> has_components=false; depth 50 finds the merge base and detects the changed component.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Reduces CI overhead with two targeted changes:
1. Deduplicate
yarn buildfrom test jobThe
testjob was runningyarn test→yarn build→verify-exports→ typechecks.The
buildjob was also runningyarn build→verify-exports.Now:
yarn test+sync-exports --checkyarn build+verify-exports+ typechecks + Storybook + SandboxRemoves ~1 min of duplicate build work from the test job, and typecheck steps move to build where the output already exists.
2. Shallow clones instead of full history
buildandcheck-componentswere usingfetch-depth: 0(full clone, ~40s).Now they do a shallow checkout + targeted
git fetch origin main --depth=1to get just the base ref needed forgit diffanalysis.Results