File tree Expand file tree Collapse file tree 2 files changed +24
-7
lines changed Expand file tree Collapse file tree 2 files changed +24
-7
lines changed Original file line number Diff line number Diff line change 1
1
name : Clear cache weekly
2
2
3
3
on :
4
+ pull_request :
5
+ paths :
6
+ - " .github/workflows/call-clear-cache.yml"
4
7
workflow_dispatch :
5
8
inputs :
6
9
pattern :
7
10
description : " pattern for cleaning cache"
8
11
default : " pip-|conda"
9
12
required : false
10
13
type : string
14
+ age-days :
15
+ description : " setting the age of caches in days to be dropped"
16
+ required : true
17
+ type : number
18
+ default : 5
19
+ schedule :
20
+ # on Sundays
21
+ - cron : " 0 0 * * 0"
11
22
12
23
jobs :
13
24
cron-clear :
14
- if : github.event_name == 'schedule'
15
- uses : Lightning-AI/utilities/.github/workflows/clear-cache .yml@v0.11.6
25
+ if : github.event_name == 'schedule' || github.event_name == 'pull_request'
26
+ uses : Lightning-AI/utilities/.github/workflows/cleanup-caches .yml@v0.11.6
16
27
with :
28
+ scripts-ref : v0.11.6
29
+ dry-run : ${{ github.event_name == 'pull_request' }}
17
30
pattern : " latest|docs"
31
+ age-days : 7
18
32
19
33
direct-clear :
20
- if : github.event_name == 'workflow_dispatch'
21
- uses : Lightning-AI/utilities/.github/workflows/clear-cache .yml@v0.11.6
34
+ if : github.event_name == 'workflow_dispatch' || github.event_name == 'pull_request'
35
+ uses : Lightning-AI/utilities/.github/workflows/cleanup-caches .yml@v0.11.6
22
36
with :
23
- pattern : ${{ inputs.pattern }}
37
+ scripts-ref : v0.11.6
38
+ dry-run : ${{ github.event_name == 'pull_request' }}
39
+ pattern : ${{ inputs.pattern || 'pypi_wheels' }} # setting str in case of PR / debugging
40
+ age-days : ${{ inputs.age-days || 0 }} # setting 0 in case of PR / debugging
Original file line number Diff line number Diff line change 1
- # https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#force-deleting-cache-entries
2
- name : cleanup caches by a branch
1
+ name : cleanup caches on a branch
3
2
on :
4
3
pull_request :
5
4
types : [closed]
6
5
7
6
jobs :
8
7
pr-cleanup :
8
+ # https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#force-deleting-cache-entries
9
9
runs-on : ubuntu-latest
10
10
steps :
11
11
- name : Check out code
You can’t perform that action at this time.
0 commit comments