forked from protocolbuffers/protobuf
-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (30 loc) · 1.03 KB
/
clear_caches.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: Clear expensive caches to prevent unbounded growth
on:
schedule:
# Run every 4 months at 10 AM UTC (2 AM PDT)
- cron: 0 10 1 */4 *
# manual
workflow_dispatch:
permissions:
contents: read
jobs:
bazel-repository-cache:
strategy:
fail-fast: false # Don't cancel all jobs if one fails.
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
name: Clear Bazel repository cache ${{ runner.os }}
runs-on: ${{ matrix.os }}
permissions:
actions: write # permission is required to delete caches
contents: read
steps:
- uses: actions/cache@627f0f41f6904a5b1efbaed9f96d9eb58e92e920 # v3.2.4
with:
path: ${{ github.workspace }}/${{ steps.output.outputs.repository-cache }}
key: repository-cache-${{ github.ref_name }}-${{ runner.os }}-reset-${{ github.sha }}
- name: Create an empty cache with a single file
run: |
rm -rf .repository-cache
mkdir -p .repository-cache'
touch .repository-cache/reset_file