ci: add Go build and test cache to unit test jobs#4812
Open
walldiss wants to merge 2 commits intocelestiaorg:mainfrom
Open
ci: add Go build and test cache to unit test jobs#4812walldiss wants to merge 2 commits intocelestiaorg:mainfrom
walldiss wants to merge 2 commits intocelestiaorg:mainfrom
Conversation
Cache ~/go/pkg/mod and ~/.cache/go-build (which holds Go's built-in test result cache) between runs. Unchanged packages are not retested. Use layered restore keys so partial cache hits still benefit from previously compiled dependencies.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4812 +/- ##
==========================================
- Coverage 44.83% 35.83% -9.00%
==========================================
Files 265 311 +46
Lines 14620 21442 +6822
==========================================
+ Hits 6555 7684 +1129
- Misses 7313 12768 +5455
- Partials 752 990 +238 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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
actions/cache@v4to the unit test matrix jobs (ubuntu + macOS) caching both~/go/pkg/modand~/.cache/go-buildactions/setup-go's implicit module cache to avoid double-caching the same pathsgo.sum+ all.gofiles; falls back to go.sum-only, then OS-only for partial hitsWhy this helps
Go stores test results in
~/.cache/go-build. When the cache is restored,go testreplays cached results for packages whose source and dependencies haven't changed — those packages are not retested at all. Combined with reusing compiled dependencies, this significantly reduces both compile and test time on PRs that touch a small subset of packages.Closes https://linear.app/celestia/issue/DA-1125