forked from llvm/circt
-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (33 loc) · 1.02 KB
/
garbageCollectCICache.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
36
37
name: Garbage collect github CI cache
# Run every hour
on:
workflow_dispatch:
schedule:
- cron: 0 * * * *
permissions:
actions: write
jobs:
run-script:
strategy:
matrix:
key_prefix: [ccache-short-clang-Release-ON-ON, sccache-windows-2022-cl-cl-release-OFF-ON-ON]
name: Garbage collect cache
runs-on: ubuntu-latest
steps:
- name: Get CIRCT
# Clone the CIRCT repo and its submodules. Do shallow clone to save clone
# time.
uses: actions/checkout@v3
with:
fetch-depth: 2
submodules: "false"
- name: Set git safe
run: |
git config --global --add safe.directory $PWD
- name: Check cache and remove
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Keep top 3 caches (in the case LLVM bump involved)
gh cache list -k ${{ matrix.key_prefix }} -L 50
gh cache list -k ${{ matrix.key_prefix }} -L 50 --jq ".[3:]|.[].id" --json id | ./utils/delete-cache.sh