Skip to content

ci: refactor self-hosted bazel setup into composite action#314

Open
moidx wants to merge 1 commit into
OpenPRoT:mainfrom
moidx:ci-refactor-setup-bazel
Open

ci: refactor self-hosted bazel setup into composite action#314
moidx wants to merge 1 commit into
OpenPRoT:mainfrom
moidx:ci-refactor-setup-bazel

Conversation

@moidx

@moidx moidx commented Jun 20, 2026

Copy link
Copy Markdown
Collaborator

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.

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>
@moidx moidx force-pushed the ci-refactor-setup-bazel branch from 277bafc to a8a189a Compare June 20, 2026 00:02
@moidx moidx requested review from cfrantz and rusty1968 June 20, 2026 00:19
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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants