ci: cache resolved Node.js version in CI#7536
Conversation
Use actions/cache to store the exact Node.js version resolved by setup-node, avoiding redundant HTTP manifest lookups across many parallel jobs per run. The cache key rotates every 20 minutes so new patches are picked up regularly. On cache hit, the exact version is passed to setup-node with check-latest disabled. On miss, check-latest resolves the latest patch and persists it for subsequent runs.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7536 +/- ##
==========================================
- Coverage 80.18% 80.16% -0.03%
==========================================
Files 731 730 -1
Lines 31212 31217 +5
==========================================
- Hits 25027 25024 -3
- Misses 6185 6193 +8 Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Overall package sizeSelf size: 4.62 MB Dependency sizes| name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 2.0.6 | 81.92 kB | 813.08 kB | | dc-polyfill | 0.1.10 | 26.73 kB | 26.73 kB |🤖 This report was automatically generated by heaviest-objects-in-the-universe |
BenchmarksBenchmark execution time: 2026-02-13 22:54:55 Comparing candidate commit a90cd55 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 229 metrics, 31 unstable metrics. |
Use actions/cache to store the exact Node.js version resolved by setup-node, avoiding redundant HTTP manifest lookups across many parallel jobs per run. The cache key rotates every 20 minutes so new patches are picked up regularly. On cache hit, the exact version is passed to setup-node with check-latest disabled. On miss, check-latest resolves the latest patch and persists it for subsequent runs.
Use actions/cache to store the exact Node.js version resolved by setup-node, avoiding redundant HTTP manifest lookups across many parallel jobs per run. The cache key rotates every 20 minutes so new patches are picked up regularly. On cache hit, the exact version is passed to setup-node with check-latest disabled. On miss, check-latest resolves the latest patch and persists it for subsequent runs.

What does this PR do?
Caches the resolved Node.js version in the shared
.github/actions/node/action.ymlcomposite action so thatactions/setup-nodecan skip its GitHub API manifest lookups on subsequent runs.When
check-latest: trueis set,setup-nodemakes two GitHub API requests to resolve the latest patch for a given major version. With hundreds of parallel CI jobs all doing this, the requests count towards our GitHub API rate limit. This PR introduces a lightweightactions/cachestep that persists the resolved version to a file. On cache hit, the exact version is passed directly tosetup-nodewithcheck-latest: false, eliminating both API calls entirely.The cache key rotates every 20 minutes (based on epoch time) so new Node.js patch releases are still picked up promptly.
Motivation
Every invocation of
setup-nodewithcheck-latest: truetriggers two GitHub REST API requests to resolve the latest version. Across our highly parallel CI matrix these add up and count towards our GitHub API rate limit. Caching the resolved version removes this overhead for the vast majority of runs.Additional Notes
.github/actions/node/action.ymlis changed; no workflow files need updating since they all delegate to this composite action.setup-nodebehaves exactly as before (check-latest: true), then the resolved version is saved for subsequent runs.