Skip to content

Commit

Permalink
Regenerate the cache completely, once a day (#253)
Browse files Browse the repository at this point in the history
  • Loading branch information
shaldengeki authored Jul 16, 2024
1 parent ad8f9c6 commit 15dfeb4
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/regenerate-cache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Regenerate cache

on:
schedule:
# Daily
- cron: '23 1 * * *'

jobs:
build:
runs-on: ubuntu-latest
steps:
# Caches and restores the bazelisk download directory, the bazel build directory.
- name: Cache bazel
uses: actions/cache@v4
env:
cache-name: bazel-cache
with:
path: |
~/.cache/bazelisk
~/.cache/bazel
~/.cache/bazel-repo
key: ${{ runner.os }}-${{ env.cache-name }}-${{ github.ref }}-${{ github.sha }}
# Pull caches from:
# - The current sha,
# - The current branch,
# - base branch
restore-keys: |
${{ runner.os }}-${{ env.cache-name }}-${{ github.ref }}-${{ github.sha }}
${{ runner.os }}-${{ env.cache-name }}-${{ github.ref }}-
${{ runner.os }}-${{ env.cache-name }}-refs/heads/${{ github.base_ref }}-
- name: Checkout
uses: actions/checkout@v4
- name: Bazel clean
run: bazel --bazelrc=.github/workflows/ci.bazelrc --bazelrc=.bazelrc clean --expunge
- name: bazel test //...
run: bazel --bazelrc=.github/workflows/ci.bazelrc --bazelrc=.bazelrc test //...

0 comments on commit 15dfeb4

Please sign in to comment.