diff --git a/.github/actions/setup-bazel-self-hosted/action.yml b/.github/actions/setup-bazel-self-hosted/action.yml new file mode 100644 index 00000000..995d2f7f --- /dev/null +++ b/.github/actions/setup-bazel-self-hosted/action.yml @@ -0,0 +1,17 @@ +# Licensed under the Apache-2.0 license + +name: 'Setup Bazel (Self-Hosted)' +description: 'Configure Bazel for self-hosted runners with local persistent caching' +runs: + using: "composite" + steps: + - name: Setup Bazel + uses: bazel-contrib/setup-bazel@0.19.0 + with: + bazelisk-cache: false + disk-cache: false + repository-cache: false + output-base: ${{ runner.workspace }}/.bazel + bazelrc: | + build --disk_cache=/home/github-runner/.cache/bazel-disk + common --repository_cache=/home/github-runner/.cache/bazel-repo diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ede19caf..b3f36b8f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,11 +20,7 @@ jobs: - uses: actions/checkout@v6 - name: Setup Bazel - uses: bazel-contrib/setup-bazel@0.19.0 - with: - bazelisk-cache: false - disk-cache: false - repository-cache: false + uses: ./.github/actions/setup-bazel-self-hosted - name: Presubmit Checks # The presubmit workflow performs formatting checks, license checks @@ -40,11 +36,7 @@ jobs: - uses: actions/checkout@v6 - name: Setup Bazel - uses: bazel-contrib/setup-bazel@0.19.0 - with: - bazelisk-cache: false - disk-cache: false - repository-cache: false + uses: ./.github/actions/setup-bazel-self-hosted - name: Run tests # See workflows.json for the `ci` definition. @@ -59,11 +51,7 @@ jobs: - uses: actions/checkout@v6 - name: Setup Bazel - uses: bazel-contrib/setup-bazel@0.19.0 - with: - bazelisk-cache: false - disk-cache: false - repository-cache: false + uses: ./.github/actions/setup-bazel-self-hosted - name: Build # See workflows.json for the `default` definition.