Skip to content

Commit

Permalink
Cache bazel build under Linux (MacOS uses local cache on runner) (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
shkoo authored Dec 13, 2024
1 parent c0e06e5 commit c6fdb7d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,22 @@ jobs:
- os: Linux
config: --config=ci
steps:
- name: Get Date
id: get-date
run: |
echo "date=$(/bin/date -u "+%Y-%m-%d")" >> $GITHUB_OUTPUT
shell: bash
- uses: actions/checkout@v3
# Cache bazel build on linux. (MacOS uses the local cache on the runner.)
- if: matrix.os == 'Linux'
uses: actions/cache@v4
env:
cache-name: bazel-build
with:
path: "~/.cache/bazel"
# Generate a new build cache once a day, reusing the previous day's if available
key: "bazel-${{ matrix.os }}-${{ steps.get-date.outputs.date }}"
restore-keys: "bazel-${{ matrix.os }}-"
- uses: ./.github/actions/bazelisk
- name: Build & test
env:
Expand Down

0 comments on commit c6fdb7d

Please sign in to comment.