feat(ci): cache build objects in between internal runs #504
+125
−97
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.
This PR consolidates and caches the Sig artifacts created by our CI process to be shared across jobs. Before, each job would set up Zig and the associated cache, which would result in around 1.5GB of cache usage per job. This quickly spiraled out of control and ended up using hundreds of GBs of cache.
The changes here create 3 main jobs for building Zig.
build
- This job builds Sig with and without TSAN, as well as a version of the tests which use the hashmap blockstore.build-release
- This job builds Sig and the fuzzer inReleaseSafe
. Since all of the dependencies need to be built inReleaseSafe
as well, it has a separate cache to minimize duplication.build-macos
- This job uses an ubuntu runner to build Sig targetingaarch64-macos
. I've set this up as a separate job for the same reason as thebuild-release
one, as well as for the future when we will hopefully have a functional MacOS runner.Another improvement I've made is creating a small Action that handles setting up and restoring the artifacts. It's located in
.github/actions/setup/action.yml
and just deduplicates a lot of similar step usages in the maincheck.yml
.All in all, the cache usage has gone from around 9GB to 1.3GB per "PR", which should stop Github from complaining in most cases, unless we have a lot of PRs open at once.
As for the CI times, after caching, the new approach less or a similar amount of time. The main improvement there is that we're not building Sig for each of the fuzzer tests.