Skip to content

Commit

Permalink
feat(ci): nightly job to completely clean up bazel caches
Browse files Browse the repository at this point in the history
  • Loading branch information
sasa-tomic committed Jan 23, 2024
1 parent d6db5ee commit 9d8593d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/bazel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
- 'main'
pull_request:
merge_group:
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '30 1 * * *'
jobs:
bazel:
runs-on: ubuntu-22.04
Expand All @@ -28,6 +31,9 @@ jobs:
key: ${{ runner.os }}-bazel-${{ hashFiles('.bazelversion', '.bazelrc', 'WORKSPACE', 'WORKSPACE.bazel', 'MODULE.bazel', 'Cargo.Bazel.lock') }}
restore-keys: |
${{ runner.os }}-bazel-
- name: If running on schedule (at night) and on main, completely delete bazel cache
if: "${{github.event.schedule == '30 1 * * *' && github.ref == 'refs/heads/main'}}"
run: sudo rm -rf ~/.cache/bazel/*
- name: Set GIT_HASH variable
run: |
# Set GIT_HASH variable based on the type of GitHub reference
Expand Down

0 comments on commit 9d8593d

Please sign in to comment.