29
29
required : false
30
30
default : false
31
31
type : boolean
32
+ skip_llvm_build :
33
+ description : " Skip building llvm if compiler is clang"
34
+ required : false
35
+ default : false
36
+ type : boolean
32
37
trigger_build :
33
38
description : " Trigger mpv build action after success build"
34
39
required : false
86
91
build_llvm :
87
92
name : Build LLVM
88
93
needs : params
89
- if : ${{ inputs.compiler =='clang' }}
94
+ if : ${{ inputs.compiler =='clang' && inputs.skip_llvm_build != true }}
95
+ continue-on-error : true
90
96
runs-on : ubuntu-latest
91
97
container :
92
98
image : archlinux/archlinux:base-devel
@@ -163,7 +169,7 @@ jobs:
163
169
build :
164
170
name : Build Toolchain
165
171
needs : [params,build_llvm]
166
- if : ${{ (inputs.compiler =='clang' && success() ) || ( inputs.compiler =='gcc' && always() ) }}
172
+ if : ${{ always() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled' ) }}
167
173
runs-on : ubuntu-latest
168
174
container :
169
175
image : archlinux/archlinux:base-devel
@@ -201,7 +207,7 @@ jobs:
201
207
mpv-winbuild-cmake/clang_root
202
208
key : llvm-${{ needs.params.outputs.cache_suffix }}
203
209
restore-keys : |
204
- llvm-${{ needs.params.outputs.cache_suffix }}
210
+ llvm-
205
211
206
212
- name : Build Toolchain
207
213
shell : bash
@@ -248,20 +254,20 @@ jobs:
248
254
ninja -C $buildroot/build$bit cargo-clean
249
255
250
256
- name : Save Toolchain Cache
251
- if : ${{ github.event. inputs.no_save_cache != ' true' }}
257
+ if : ${{ inputs.no_save_cache != true }}
252
258
uses : actions/cache/save@v3.3.2
253
259
with :
254
260
path : ${{ github.workspace }}/mpv-winbuild-cmake/build${{ matrix.bit }}
255
261
key : toolchain-${{ inputs.compiler }}-build${{ matrix.bit }}-${{ needs.params.outputs.cache_suffix }}
256
262
257
263
- name : Save clang_root cache
258
- if : ${{ inputs.compiler =='clang' }}
264
+ if : ${{ inputs.compiler =='clang' && inputs.no_save_cache != true }}
259
265
uses : actions/cache/save@v3.3.2
260
266
with :
261
267
path : ${{ github.workspace }}/mpv-winbuild-cmake/clang_root
262
268
key : clang_root-${{ needs.params.outputs.cache_suffix }}
263
269
- name : Save Rust Cache
264
- if : ${{ github.event. inputs.no_save_cache != ' true' }}
270
+ if : ${{ inputs.no_save_cache != true }}
265
271
uses : actions/cache/save@v3.3.2
266
272
with :
267
273
path : ${{ github.workspace }}/mpv-winbuild-cmake/install_rustup
@@ -281,7 +287,7 @@ jobs:
281
287
282
288
trigger :
283
289
needs : [build,params]
284
- if : ${{ github.event. inputs.trigger_build != ' false' && always( ) }}
290
+ if : ${{ always() && inputs.trigger_build != false && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled' ) }}
285
291
runs-on : ubuntu-latest
286
292
287
293
steps :
@@ -291,7 +297,7 @@ jobs:
291
297
retries : 3
292
298
script : |
293
299
let build_target=new Set();
294
- const release = " ${{ github.event. inputs.release }}" == 'true' ? true : false ;
300
+ const release = ${{ inputs.release }};
295
301
const targets = {"build64-v3":"64bit-v3","build64":"64bit","build32":"32bit"}
296
302
const repo="${{github.repository}}".split('/')[1];
297
303
const cache_suffix="${{ needs.params.outputs.cache_suffix }}";
@@ -309,6 +315,7 @@ jobs:
309
315
for(const [key, value] of Object.entries(targets)){
310
316
if (i.key.includes(key)) {
311
317
build_target.add(value);
318
+ core.info(`Found success ${value} build cache: ${i.key}.`)
312
319
break;
313
320
}
314
321
}
@@ -339,4 +346,6 @@ jobs:
339
346
}
340
347
})
341
348
}
349
+ } else {
350
+ core.setFailed("Don't find any success build cache");
342
351
}
0 commit comments