File tree 1 file changed +26
-37
lines changed
1 file changed +26
-37
lines changed Original file line number Diff line number Diff line change 1
1
name : CI
2
2
on :
3
- push :
4
- branches :
5
- - auto-cargo
6
- - try
7
- - automation/bors/try
3
+ merge_group :
8
4
pull_request :
9
5
branches :
10
6
- " **"
@@ -17,46 +13,39 @@ permissions:
17
13
contents : read
18
14
19
15
concurrency :
20
- group : " ${{ github.workflow }}-${{ (github.ref == 'refs/heads/try' && github.sha) || github.ref }}"
16
+ group : " ${{ github.workflow }}-${{ github.ref }}"
21
17
cancel-in-progress : true
22
18
23
19
jobs :
24
- success :
25
- permissions :
26
- contents : none
27
- name : bors build finished
20
+ conclusion :
28
21
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
43
31
permissions :
44
32
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() }}
56
40
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'"
58
41
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) }}'
60
49
61
50
# Check Code style quickly by running `rustfmt` over all code
62
51
rustfmt :
You can’t perform that action at this time.
0 commit comments