From 796f8ce546c5abe0595fd843a339cad7b3ff2090 Mon Sep 17 00:00:00 2001 From: Titus Fortner Date: Tue, 26 May 2026 18:59:12 -0500 Subject: [PATCH 1/2] [build] add Github Cache workflow and cancel-on-failure guard in bazel.yml --- .github/workflows/bazel.yml | 7 ++++++- .github/workflows/ci-rbe.yml | 1 + .github/workflows/gh-cache.yml | 29 +++++++++++++++++++++-------- 3 files changed, 28 insertions(+), 9 deletions(-) diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index ebc03b771cee6..e24c3841b632f 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -166,7 +166,6 @@ jobs: bazelrc: common --color=yes # Workaround for long path issues: https://github.com/bazelbuild/bazel/pull/22532 output-base: ${{ inputs.os == 'windows' && 'D://b' || '' }} - cache-version: 2 disk-cache: false external-cache: | manifest: @@ -297,3 +296,9 @@ jobs: if [ "$AVAIL_GB" -lt 5 ]; then echo "::warning::Low disk space: ${AVAIL_GB}GB remaining" fi + - name: Cancel run on bazel failure to prevent poisoned cache save + if: failure() && steps.run-bazel.outcome == 'failure' && inputs.cache-save + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + shell: bash + run: gh run cancel ${{ github.run_id }} diff --git a/.github/workflows/ci-rbe.yml b/.github/workflows/ci-rbe.yml index 1a53330d5be06..bd198151bd133 100644 --- a/.github/workflows/ci-rbe.yml +++ b/.github/workflows/ci-rbe.yml @@ -21,6 +21,7 @@ concurrency: permissions: contents: read packages: read + actions: write jobs: test: diff --git a/.github/workflows/gh-cache.yml b/.github/workflows/gh-cache.yml index 711b5574802d1..2b01857e2a6a8 100644 --- a/.github/workflows/gh-cache.yml +++ b/.github/workflows/gh-cache.yml @@ -1,14 +1,28 @@ -name: CI Cache +name: Github Cache on: + push: + branches: [trunk] + paths: + - 'MODULE.bazel' + - 'rust/Cargo.lock' + - 'java/maven_install.json' + - 'py/requirements_lock.txt' + - 'rb/Gemfile.lock' + - 'dotnet/paket.lock' + - 'common/repositories.bzl' + - 'common/browsers.bzl' + schedule: + - cron: '30 6 * * *' workflow_dispatch: concurrency: - group: ci-cache-${{ github.ref }} + group: gh-cache-${{ github.ref }} cancel-in-progress: true permissions: contents: read + actions: write jobs: populate: @@ -21,9 +35,8 @@ jobs: with: name: ${{ matrix.os }} os: ${{ matrix.os }} - cache-save: false - run: > - bazel build --nobuild --build_tests_only --keep_going - --repo_contents_cache= - //java/... //py/... //rb/... //rust/... - //javascript/selenium-webdriver/... //dotnet/... + cache-save: true + run: >- + bazel build --nobuild --build_tests_only --keep_going --repo_contents_cache= + //java/test/... //py:* //rb/spec/... //rust/tests/... + //javascript/selenium-webdriver:* //dotnet/test/... From 21a1dae0f58553b5a98368ca6aa29a8c39848211 Mon Sep 17 00:00:00 2001 From: Titus Fortner Date: Wed, 27 May 2026 07:22:56 -0500 Subject: [PATCH 2/2] [build] remove cancel-on-failure guard and capitalize GitHub Cache --- .github/workflows/bazel.yml | 6 ------ .github/workflows/ci-rbe.yml | 1 - .github/workflows/gh-cache.yml | 3 +-- 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index e24c3841b632f..6e3d8ee9360cd 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -296,9 +296,3 @@ jobs: if [ "$AVAIL_GB" -lt 5 ]; then echo "::warning::Low disk space: ${AVAIL_GB}GB remaining" fi - - name: Cancel run on bazel failure to prevent poisoned cache save - if: failure() && steps.run-bazel.outcome == 'failure' && inputs.cache-save - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - shell: bash - run: gh run cancel ${{ github.run_id }} diff --git a/.github/workflows/ci-rbe.yml b/.github/workflows/ci-rbe.yml index bd198151bd133..1a53330d5be06 100644 --- a/.github/workflows/ci-rbe.yml +++ b/.github/workflows/ci-rbe.yml @@ -21,7 +21,6 @@ concurrency: permissions: contents: read packages: read - actions: write jobs: test: diff --git a/.github/workflows/gh-cache.yml b/.github/workflows/gh-cache.yml index 2b01857e2a6a8..0ff5c13b65cd0 100644 --- a/.github/workflows/gh-cache.yml +++ b/.github/workflows/gh-cache.yml @@ -1,4 +1,4 @@ -name: Github Cache +name: GitHub Cache on: push: @@ -22,7 +22,6 @@ concurrency: permissions: contents: read - actions: write jobs: populate: