File tree 7 files changed +25
-34
lines changed
7 files changed +25
-34
lines changed Original file line number Diff line number Diff line change 49
49
open(fpath, 'w').write(req)
50
50
shell : python
51
51
52
- - run : echo "::set-output name=period::$(python -c 'import time ; days = time.time() / 60 / 60 / 24 ; print(int(days / 7))' 2>&1)"
53
- if : matrix.requires == 'latest'
54
- id : times
55
-
56
52
# Note: This uses an internal pip API and may not always work
57
53
# https://github.com/actions/cache/blob/master/examples.md#multiple-oss-in-a-workflow
58
54
- name : Get pip cache
64
60
uses : actions/cache@v3
65
61
with :
66
62
path : ${{ steps.pip-cache.outputs.dir }}
67
- key : ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ matrix.requires }}-td${{ steps.times.outputs.period }}- ${{ hashFiles('requirements/app/base.txt') }}
68
- restore-keys : ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ matrix.requires }}-td${{ steps.times.outputs.period }}-
63
+ key : ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ matrix.requires }}-${{ hashFiles('requirements/app/base.txt') }}
64
+ restore-keys : ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ matrix.requires }}-
69
65
70
66
- name : Install dependencies
71
67
run : |
Original file line number Diff line number Diff line change 46
46
open(fpath, 'w').write(req)
47
47
shell : python
48
48
49
- - run : echo "::set-output name=period::$(python -c 'import time ; days = time.time() / 60 / 60 / 24 ; print(int(days / 7))' 2>&1)"
50
- if : matrix.requires == 'latest'
51
- id : times
52
-
53
- # Note: This uses an internal pip API and may not always work
54
- # https://github.com/actions/cache/blob/master/examples.md#multiple-oss-in-a-workflow
55
49
- name : Get pip cache
56
50
id : pip-cache
57
51
run : |
61
55
uses : actions/cache@v3
62
56
with :
63
57
path : ${{ steps.pip-cache.outputs.dir }}
64
- key : ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ matrix.requires }}-td${{ steps.times.outputs.period }}- ${{ hashFiles('requirements/app/base.txt') }}
65
- restore-keys : ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ matrix.requires }}-td${{ steps.times.outputs.period }}-
58
+ key : ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ matrix.requires }}-${{ hashFiles('requirements/app/base.txt') }}
59
+ restore-keys : ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ matrix.requires }}-
66
60
67
61
- name : Install dependencies
68
62
run : |
Original file line number Diff line number Diff line change 45
45
with :
46
46
python-version : ${{ matrix.python-version }}
47
47
48
- - name : Reset caching
49
- run : python -c "import time; days = time.time() / 60 / 60 / 24; print(f'TIME_PERIOD=d{int(days / 2) * 2}')" >> $GITHUB_ENV
50
-
51
48
- name : basic setup
52
49
run : |
53
50
pip --version
73
70
uses : actions/cache@v3
74
71
with :
75
72
path : ${{ steps.pip-cache.outputs.dir }}
76
- key : ${{ runner.os }}-pip-td${{ env.TIME_PERIOD }}- py${{ matrix.python-version }}-${{ matrix.release }}-${{ matrix.requires }}-${{ hashFiles('requirements/lite/*.txt') }}
73
+ key : ${{ runner.os }}-pip-py${{ matrix.python-version }}-${{ matrix.release }}-${{ matrix.requires }}-${{ hashFiles('requirements/lite/*.txt') }}
77
74
restore-keys : |
78
- ${{ runner.os }}-pip-td${{ env.TIME_PERIOD }}- py${{ matrix.python-version }}-${{ matrix.release }}-${{ matrix.requires }}-
75
+ ${{ runner.os }}-pip-py${{ matrix.python-version }}-${{ matrix.release }}-${{ matrix.requires }}-
79
76
80
77
- name : Install dependencies
81
78
env :
Original file line number Diff line number Diff line change 60
60
with :
61
61
python-version : ${{ matrix.python-version }}
62
62
63
- - name : Reset caching
64
- run : python -c "import time; days = time.time() / 60 / 60 / 24; print(f'TIME_PERIOD=d{int(days / 2) * 2}')" >> $GITHUB_ENV
65
-
66
63
- name : basic setup
67
64
run : |
68
65
pip --version
91
88
uses : actions/cache@v3
92
89
with :
93
90
path : ${{ steps.pip-cache.outputs.dir }}
94
- key : ${{ runner.os }}-pip-td${{ env.TIME_PERIOD }}- py${{ matrix.python-version }}-${{ matrix.release }}-${{ matrix.requires }}-${{ hashFiles('requirements/pytorch/*.txt') }}
91
+ key : ${{ runner.os }}-pip-py${{ matrix.python-version }}-${{ matrix.release }}-${{ matrix.requires }}-${{ hashFiles('requirements/pytorch/*.txt') }}
95
92
restore-keys : |
96
- ${{ runner.os }}-pip-td${{ env.TIME_PERIOD }}- py${{ matrix.python-version }}-${{ matrix.release }}-${{ matrix.requires }}-
93
+ ${{ runner.os }}-pip-py${{ matrix.python-version }}-${{ matrix.release }}-${{ matrix.requires }}-
97
94
98
95
- name : Pull legacy checkpoints
99
96
run : bash .actions/pull_legacy_checkpoints.sh
Original file line number Diff line number Diff line change 41
41
with :
42
42
python-version : ${{ matrix.python-version }}
43
43
44
- - name : Reset caching
45
- run : python -c "import time; days = time.time() / 60 / 60 / 24; print(f'TIME_PERIOD=d{int(days / 2) * 2}')" >> $GITHUB_ENV
46
-
47
44
- name : Get pip cache
48
45
id : pip-cache
49
46
run : |
53
50
uses : actions/cache@v3
54
51
with :
55
52
path : ${{ steps.pip-cache.outputs.dir }}
56
- key : ${{ runner.os }}-pip-td${{ env.TIME_PERIOD }}- py${{ matrix.python-version }}-${{ hashFiles('requirements/pytorch/base.txt') }}
53
+ key : ${{ runner.os }}-pip-py${{ matrix.python-version }}-${{ hashFiles('requirements/pytorch/base.txt') }}
57
54
restore-keys : |
58
- ${{ runner.os }}-pip-td${{ env.TIME_PERIOD }}- py${{ matrix.python-version }}-
55
+ ${{ runner.os }}-pip-py${{ matrix.python-version }}-
59
56
60
57
- name : Install dependencies
61
58
env :
Original file line number Diff line number Diff line change @@ -27,18 +27,15 @@ jobs:
27
27
with :
28
28
python-version : 3.9
29
29
30
- - name : Reset caching
31
- run : python -c "import time; days = time.time() / 60 / 60 / 24; print(f'TIME_PERIOD=d{int(days / 2) * 2}')" >> $GITHUB_ENV
32
-
33
30
# Note: This uses an internal pip API and may not always work
34
31
# https://github.com/actions/cache/blob/master/examples.md#multiple-oss-in-a-workflow
35
32
- name : Cache pip
36
33
uses : actions/cache@v3
37
34
with :
38
35
path : ~/.cache/pip
39
- key : ${{ runner.os }}-docs-test-pip-td${{ env.TIME_PERIOD }}- ${{ hashFiles('requirements/${{ matrix.pkg }}/*.txt') }}
36
+ key : ${{ runner.os }}-docs-test-pip-${{ hashFiles('requirements/${{ matrix.pkg }}/*.txt') }}
40
37
restore-keys : |
41
- ${{ runner.os }}-docs-test-pip-td${{ env.TIME_PERIOD }}-
38
+ ${{ runner.os }}-docs-test-pip-
42
39
43
40
- name : Install dependencies
44
41
env :
Original file line number Diff line number Diff line change
1
+ name : Clear cache weekly
2
+
3
+ on :
4
+ schedule :
5
+ # on Sundays
6
+ - cron : " 0 0 * * 0"
7
+
8
+ jobs :
9
+ clear-cache :
10
+ if : ${{ github.repository_owner == 'Lightning-AI' }}
11
+ uses : Lightning-AI/utilities/.github/workflows/clear-cache.yml@main
12
+ with :
13
+ pattern : ' latest|docs'
You can’t perform that action at this time.
0 commit comments