mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 22:02:23 +01:00
The built-in GitHub action cache is too broken for us to use currently. Pull request runs will evict trunk runs from the cache easily, which will remove a useful baseline and make builds generally uncached and extremely slow. Instead, move to using Bazel's remote caching functionality with a GCP storage bucket. This gives us nearly limitless storage and is actually vastly simpler than the prior arrangement. It should also allow cache sharing between different build configurations and other benefits. This cache isn't usable by anyone else sadly, but it should at least provide a better scaling technique for our CI. This does require us to move from `pull_request` workflow to a `pull_request_target` workflow and run the CI within the domain of the project. This is only really safe for us to do while the project remains private. When we go public we'll want to make the cache publicly readable and change this code so that when not running on a branch in the main repository we use the cache in a read-only mode and only write back updates for branch runs. This should still be effective but requires a bit more complexity here and in the remote cache including setting up public access. For now, going with the simple if slightly less secure model.