File tree 1 file changed +17
-6
lines changed
1 file changed +17
-6
lines changed Original file line number Diff line number Diff line change 50
50
pip install -r dev_requirements.txt
51
51
invoke linters
52
52
53
+ get-date :
54
+ name : Get current date for cache
55
+ outputs :
56
+ current_date : ${{ steps.date.outputs.current_date }}
57
+ runs-on : ubuntu-latest
58
+ steps :
59
+ - name : Set current date
60
+ id : date
61
+ run : echo "current_date=$(date -u +'%Y%m%d')" >> $GITHUB_OUTPUT
62
+
53
63
populate-cache :
54
64
runs-on : ubuntu-latest
65
+ needs : [get-date, dependency-audit, lint]
55
66
timeout-minutes : 60
56
67
name : Update docker cache
57
68
steps :
61
72
uses : actions/cache@v4
62
73
with :
63
74
path : ./custom-cache/
64
- key : custom-cache
65
- - if : ${{ steps.custom-cache.outputs.cache-hit != 'true' || github.event_name == 'schedule' }}
75
+ key : custom-cache-${{ needs.get-date.outputs.current_date }}
76
+ - if : ${{ steps.custom-cache.outputs.cache-hit != 'true' }}
66
77
name : Update Cache
67
78
run : |
68
79
mkdir -p ./custom-cache/
72
83
73
84
run-tests :
74
85
runs-on : ubuntu-latest
75
- needs : [populate-cache]
86
+ needs : [populate-cache, get-date ]
76
87
timeout-minutes : 60
77
88
strategy :
78
89
max-parallel : 15
98
109
with :
99
110
path : ./custom-cache/
100
111
fail-on-cache-miss : true
101
- key : custom-cache
112
+ key : custom-cache-${{ needs.get-date.outputs.current_date }}
102
113
- name : Use Cache
103
114
run : docker image load -i ./custom-cache/all.tar
104
115
@@ -137,7 +148,7 @@ jobs:
137
148
build_and_test_package :
138
149
name : Validate building and installing the package
139
150
runs-on : ubuntu-latest
140
- needs : [run-tests]
151
+ needs : [run-tests, get-date, populate-cache ]
141
152
strategy :
142
153
fail-fast : false
143
154
matrix :
@@ -154,7 +165,7 @@ jobs:
154
165
with :
155
166
path : ./custom-cache/
156
167
fail-on-cache-miss : true
157
- key : custom-cache
168
+ key : custom-cache-${{ needs.get-date.outputs.current_date }}
158
169
- name : Use Cache
159
170
run : docker image load -i ./custom-cache/all.tar
160
171
You can’t perform that action at this time.
0 commit comments