ci: shave dead-weight checkout + cache TypeScript incremental builds - #4951
Merged
Conversation
…nner CPU count validate-code's Codecov upload steps moved to validate-tests when coverage was split out (#4815) -- it no longer needs fetch-depth: 0 (measured: shallow checkout is ~3s faster than full-history on this repo). Also adds a temporary nproc diagnostic to validate-tests to check whether --maxWorkers=4 (pinned to the assumed standard-runner vCPU count) actually matches the real runner spec, or whether there's free parallelism available without adding more shards.
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4951 +/- ##
=======================================
Coverage 94.24% 94.24%
=======================================
Files 445 445
Lines 38869 38869
Branches 14157 14157
=======================================
Hits 36633 36633
Misses 1577 1577
Partials 659 659
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
4 tasks
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
validate-code: its Codecov upload steps moved tovalidate-testsin ci: shard the full-suite coverage run across a matrix #4815, but thefetch-depth: 0it needed for that stayed behind. Measured ~3s of pure waste per run (5s full-history checkout vs 2s shallow, same repo).tsc's own--incrementalmode and caches.tsbuildinfoacrossvalidate-coderuns. Measured ~13.5s cold vs ~3.6s warm locally on this codebase's typecheck -- a real cut on a step that runs unconditionally on every backend-touching PR. Uses the run_id-suffixed-key + restore-keys-prefix pattern (not the hit-or-miss patternnode_modulescaching uses elsewhere in this job) since.tsbuildinfomutates every run rather than being immutable per lockfile.nprocdiagnostic to a shard job to check whether--maxWorkers=4actually matches the real runner's vCPU count, or whether free parallelism was being left on the table. Confirmed 4 -- already exactly matched, no headroom there. Diagnostic removed now that it's answered.Why
Follow-up "squeeze CI without adding more shards" pass after #4944. This was originally going to be one commit on #4944 but didn't make it into that squash-merge, so it's a standalone PR.
Correctness
For the incremental-typecheck change specifically: introduced a deliberate type error locally with a warm incremental cache present, confirmed
tscstill reports it (real exit code 1); confirmed a clean tree still exits 0 after removing it.tscverifies each file's content hash before trusting cached state, so a fresh CI checkout's reset mtimes can't produce a false cache hit that masks a real error.Test plan
npx tsc --noEmitclean (both cold and with a warm incremental cache)npm run actionlintcleannprocon a real shard runner: 4, matching--maxWorkers=4