Skip to content

Commit c7d4d22

Browse files
ci: Cache Bazel data from linting step. (#242)
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.
1 parent 8496107 commit c7d4d22

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

.github/workflows/lint.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,27 @@ jobs:
1212
runs-on: 'ubuntu-22.04'
1313
steps:
1414
- uses: actions/checkout@v4
15+
# Keep in sync with ci.yml
16+
- name: Manually evict cache entry if applicable
17+
run: ACCESS_TOKEN='${{ secrets.GITHUB_TOKEN }}' python3 .github/workflows/evict.py
18+
- name: "🚀 Mount Bazel build cache"
19+
uses: actions/cache@v4
20+
with:
21+
path: ~/bazelcache/build
22+
key: lint-bazel-build-${{ runner.os }}-${{ github.sha }}
23+
restore-keys: |
24+
lint-bazel-build-${{ runner.os }}-
25+
lint-bazel-build-
26+
- name: "🚀 Mount Bazel repo cache"
27+
uses: actions/cache@v4
28+
with:
29+
path: ~/bazelcache/repos
30+
key: lint-bazel-repos-${{ runner.os }}-${{ hashFiles('WORKSPACE') }}
31+
restore-keys: |
32+
lint-bazel-repos-${{ runner.os }}-
33+
lint-bazel-repos-
34+
- name: "⚙️ Setup Bazel"
35+
run: .github/workflows/setup-bazel.sh
1536
- name: Format Bazel files
1637
run: |
1738
./tools/scripts/format_build_files.sh

0 commit comments

Comments
 (0)