Commit c71d804
authored
ci: improve CI caching scheme (#1994)
I recently discovered that the caching of our ccache was either not
working at all, or was much less efficient/helpful than I thought. So
there are a number of improvements here:
- Split caching into separate restore/save, and rearrange the step
order so we save cache before tests run. This allows us to save the
ccache even for jobs with failed tests (where the job fails), or for
jobs that we purposely end early (maybe because we see failing
tests), not only when all tests finish and succeed. This makes
subsequent builds, that we do on the same branch while attempting to
fix failures, go faster by using the cache.
- Make subsequent pushes to the same PR or REF to cancel any previous
jobs, so if we push updates before the last CI run of the same
branch completes, it won't keep those going as useless zombie jobs.
- Change the cache key names we use to remove the github ref to
encourage cache reuse across different commits or branches (I
think), and to fix a couple errors where we had mis-named things and
were sharing caches between jobs when we shouldn't or vice versa.
- Be more careful about the location of the cache, making sure we were
for sure telling the GHA cache action to be saving/restoring the
same directory location that we told ccache to use as its cache.
- Use CCACHE_COMPRESSION env var to be extra sure we're using
compressed caches to be sure we get the best bang for buck on the
limited cache storage we're allowed.
In all, there were a number of subtle things broken. Give it a good
scrubbing. I'm not really sure exactly which one of these, or which
combination, was most responsible for getting things unstuck, but it
definitely works! Some results from two test pushes in a row I did
after these changes:
build deps build osl
VFXP 2024 / cold 4:12 6:11
VFXP 2024 / cached 1:42 (2.5x) 0:48 (7x)
ABI check / cold 4:11 6:14 + 5:38(abi ref)
ABI check / cached 0:57 (4.4x) 0:46 + 0:16 (11.5x)
bleeding edge / cold 8:12 9:57
bleeding edge / cached 1:39 (5x) 0:44 (13.6x)
It varies across jobs and from run to run, but let's call it something
in the neighbourhood of 4x speedup building dependencies and 10x
building OSL itself. It's not better because it doesn't speed up
linking, and not all of the dependencies' build systems are doing
things in a way that is amenable to ccache inserting itself into the
process. Still, this should be a big help in reducing the time of
our CI runs.
---------
Signed-off-by: Larry Gritz <lg@larrygritz.com>1 parent 915b3fa commit c71d804
File tree
5 files changed
+68
-50
lines changed- .github/workflows
- src
- build-scripts
- cmake
5 files changed
+68
-50
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | 118 | | |
130 | 119 | | |
131 | 120 | | |
132 | 121 | | |
133 | 122 | | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
134 | 135 | | |
135 | 136 | | |
136 | 137 | | |
| |||
162 | 163 | | |
163 | 164 | | |
164 | 165 | | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
165 | 186 | | |
166 | 187 | | |
167 | 188 | | |
| |||
186 | 207 | | |
187 | 208 | | |
188 | 209 | | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | 210 | | |
204 | 211 | | |
205 | 212 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
39 | 44 | | |
40 | 45 | | |
41 | 46 | | |
| |||
87 | 92 | | |
88 | 93 | | |
89 | 94 | | |
90 | | - | |
| 95 | + | |
91 | 96 | | |
92 | 97 | | |
93 | 98 | | |
| |||
151 | 156 | | |
152 | 157 | | |
153 | 158 | | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
154 | 163 | | |
155 | 164 | | |
156 | 165 | | |
157 | 166 | | |
158 | 167 | | |
159 | | - | |
| 168 | + | |
160 | 169 | | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
168 | 174 | | |
169 | 175 | | |
170 | 176 | | |
| |||
307 | 313 | | |
308 | 314 | | |
309 | 315 | | |
310 | | - | |
| 316 | + | |
311 | 317 | | |
312 | 318 | | |
313 | 319 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
16 | 24 | | |
17 | 25 | | |
18 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
217 | 217 | | |
218 | 218 | | |
219 | 219 | | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | 220 | | |
225 | 221 | | |
226 | 222 | | |
| |||
229 | 225 | | |
230 | 226 | | |
231 | 227 | | |
232 | | - | |
233 | | - | |
| 228 | + | |
| 229 | + | |
234 | 230 | | |
235 | 231 | | |
236 | 232 | | |
237 | | - | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
238 | 240 | | |
239 | 241 | | |
240 | 242 | | |
| |||
247 | 249 | | |
248 | 250 | | |
249 | 251 | | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
| 252 | + | |
| 253 | + | |
258 | 254 | | |
259 | 255 | | |
260 | 256 | | |
| |||
0 commit comments