ci: refactor self-hosted bazel setup into composite action#314
Open
moidx wants to merge 1 commit into
Open
Conversation
Refactors the repeated setup-bazel steps in ci.yml into a local
composite action (.github/actions/setup-bazel-self-hosted).
This ensures a consistent configuration across all CI jobs, including:
- Disabling GitHub-backed caching to avoid redundancy and conflicts.
- Setting a unique output base per runner (${{ runner.workspace }}/.bazel)
to avoid server trashing.
- Configuring local persistent cache paths in the runner's home directory.
Future updates to the self-hosted Bazel configuration can now be
managed in a single place.
Signed-off-by: Miguel Osorio <miguelosorio@google.com>
277bafc to
a8a189a
Compare
cfrantz
approved these changes
Jun 20, 2026
Comment on lines
+15
to
+17
| bazelrc: | | ||
| build --disk_cache=/home/github-runner/.cache/bazel-disk | ||
| common --repository_cache=/home/github-runner/.cache/bazel-repo |
Collaborator
There was a problem hiding this comment.
If you can control which file this gets written to (e.g. self-hosted.bazelrc), we could use a try-import in the project's .bazelrc to import it if-and-only-if it exists.
In our .bazelrc, we'd add something like this:
# User bazelrc file
# =================
# See https://bazel.build/configure/best-practices#bazelrc-file
#
# Note: this should be at the bottom of the file, so that user-specified
# options override anything in this file
# (https://bazel.build/run/bazelrc#imports)
try-import %workspace%/self-hosted.bazelrc
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.
Refactors the repeated setup-bazel steps in ci.yml into a local
composite action (.github/actions/setup-bazel-self-hosted).
This ensures a consistent configuration across all CI jobs, including:
to avoid server trashing.
Future updates to the self-hosted Bazel configuration can now be
managed in a single place.