From 21d39dbe474048fe7e719b889bf0c695e28accb8 Mon Sep 17 00:00:00 2001 From: Varun Gandhi Date: Fri, 7 Nov 2025 20:41:03 +0800 Subject: [PATCH] ci: Cache Bazel data from linting step. Right now, we keep rebuilding protoc from scratch (as a dependency of Buildifier...?) which doesn't make sense. We should just cache things. Ideally, we would just depend on pre-built buildifier binaries, such as in https://github.com/keith/buildifier-prebuilt, but we don't want to have divergence in the build config from upstream, if possible. --- .github/workflows/lint.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index f1b95c39b..497d52faf 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -12,6 +12,27 @@ jobs: runs-on: 'ubuntu-22.04' steps: - uses: actions/checkout@v4 + # Keep in sync with ci.yml + - name: Manually evict cache entry if applicable + run: ACCESS_TOKEN='${{ secrets.GITHUB_TOKEN }}' python3 .github/workflows/evict.py + - name: "🚀 Mount Bazel build cache" + uses: actions/cache@v4 + with: + path: ~/bazelcache/build + key: lint-bazel-build-${{ runner.os }}-${{ github.sha }} + restore-keys: | + lint-bazel-build-${{ runner.os }}- + lint-bazel-build- + - name: "🚀 Mount Bazel repo cache" + uses: actions/cache@v4 + with: + path: ~/bazelcache/repos + key: lint-bazel-repos-${{ runner.os }}-${{ hashFiles('WORKSPACE') }} + restore-keys: | + lint-bazel-repos-${{ runner.os }}- + lint-bazel-repos- + - name: "⚙️ Setup Bazel" + run: .github/workflows/setup-bazel.sh - name: Format Bazel files run: | ./tools/scripts/format_build_files.sh