mirror of
https://github.com/nolen777/eagle0.git
synced 2026-07-28 22:55:41 +00:00
* Add weekly Bazel cache cleanup workflow Removes Bazel output bases not accessed in 7 days to prevent disk space accumulation on self-hosted runners. Keeps 'cache' and 'install' directories. Remote cache means minimal perf impact from clearing local output bases. Runs weekly on Sunday at 00:00 UTC, can also be triggered manually. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Use bazel clean instead of find-based cleanup The previous approach looked for output bases not accessed in 7 days, but since the runner is used regularly, those directories always have recent access times and would never be cleaned up. Using `bazel clean` weekly clears the local output base, freeing disk space. The next build will be slightly slower but will pull from remote cache. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
37 lines
987 B
YAML
37 lines
987 B
YAML
name: Bazel Cache Cleanup
|
|
|
|
on:
|
|
schedule:
|
|
# Run weekly on Sunday at 00:00 UTC
|
|
- cron: '0 0 * * 0'
|
|
workflow_dispatch: # Allow manual trigger
|
|
|
|
jobs:
|
|
cleanup:
|
|
runs-on: [self-hosted, bazel]
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Show disk usage before cleanup
|
|
run: |
|
|
echo "=== Disk usage before cleanup ==="
|
|
BAZEL_USER_ROOT="/private/var/tmp/_bazel_$(whoami)"
|
|
echo "Bazel user root: $BAZEL_USER_ROOT"
|
|
du -sh "$BAZEL_USER_ROOT" 2>/dev/null || echo "Not found"
|
|
df -h .
|
|
|
|
- name: Run bazel clean
|
|
run: |
|
|
echo "=== Running bazel clean ==="
|
|
bazel clean
|
|
echo "Clean complete"
|
|
|
|
- name: Show disk usage after cleanup
|
|
run: |
|
|
echo "=== Disk usage after cleanup ==="
|
|
BAZEL_USER_ROOT="/private/var/tmp/_bazel_$(whoami)"
|
|
du -sh "$BAZEL_USER_ROOT" 2>/dev/null || echo "Not found"
|
|
df -h .
|