File tree Expand file tree Collapse file tree 1 file changed +26
-37
lines changed Expand file tree Collapse file tree 1 file changed +26
-37
lines changed Original file line number Diff line number Diff line change 11name : CI
22on :
3- push :
4- branches :
5- - auto-cargo
6- - try
7- - automation/bors/try
3+ merge_group :
84 pull_request :
95 branches :
106 - " **"
@@ -17,46 +13,39 @@ permissions:
1713 contents : read
1814
1915concurrency :
20- group : " ${{ github.workflow }}-${{ (github.ref == 'refs/heads/try' && github.sha) || github.ref }}"
16+ group : " ${{ github.workflow }}-${{ github.ref }}"
2117 cancel-in-progress : true
2218
2319jobs :
24- success :
25- permissions :
26- contents : none
27- name : bors build finished
20+ conclusion :
2821 needs :
29- - build_std
30- - clippy
31- - msrv
32- - docs
33- - lockfile
34- - resolver
35- - rustfmt
36- - test
37- - test_gitoxide
38- runs-on : ubuntu-latest
39- if : " success() && github.event_name == 'push' && (github.ref == 'refs/heads/auto-cargo' || github.ref == 'refs/heads/try') && github.repository == 'rust-lang/cargo'"
40- steps :
41- - run : echo ok
42- failure :
22+ - build_std
23+ - clippy
24+ - msrv
25+ - docs
26+ - lockfile
27+ - resolver
28+ - rustfmt
29+ - test
30+ - test_gitoxide
4331 permissions :
4432 contents : none
45- name : bors build finished
46- needs :
47- - build_std
48- - clippy
49- - msrv
50- - docs
51- - lockfile
52- - resolver
53- - rustfmt
54- - test
55- - test_gitoxide
33+ # We need to ensure this job does *not* get skipped if its dependencies fail,
34+ # because a skipped job is considered a success by GitHub. So we have to
35+ # overwrite `if:`. We use `!cancelled()` to ensure the job does still not get run
36+ # when the workflow is canceled manually.
37+ #
38+ # ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
39+ if : ${{ !cancelled() }}
5640 runs-on : ubuntu-latest
57- if : " !success() && github.event_name == 'push' && (github.ref == 'refs/heads/auto-cargo' || github.ref == 'refs/heads/try') && github.repository == 'rust-lang/cargo'"
5841 steps :
59- - run : exit 1
42+ # Manually check the status of all dependencies. `if: failure()` does not work.
43+ - name : Conclusion
44+ run : |
45+ # Print the dependent jobs to see them in the CI log
46+ jq -C <<< '${{ toJson(needs) }}'
47+ # Check if all jobs that we depend on (in the needs array) were successful.
48+ jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'
6049
6150 # Check Code style quickly by running `rustfmt` over all code
6251 rustfmt :
You can’t perform that action at this time.
0 commit comments