File tree Expand file tree Collapse file tree 2 files changed +22
-20
lines changed Expand file tree Collapse file tree 2 files changed +22
-20
lines changed Original file line number Diff line number Diff line change @@ -68,16 +68,17 @@ jobs:
6868 components : rustfmt
6969 - run : cargo fmt --all --check
7070
71- ci-success :
72- name : Complete
71+ # One job that "summarizes" the success state of this pipeline. This can then be added to branch
72+ # protection, rather than having to add each job separately.
73+ success :
74+ name : Success
7375 runs-on : ubuntu-latest
7476 needs : [test, i586, no_std, fmt]
77+ # Github branch protection is exceedingly silly and treats "jobs skipped because a dependency
78+ # failed" as success. So we have to do some contortions to ensure the job fails if any of its
79+ # dependencies fails.
80+ if : always() # make sure this is never "skipped"
7581 steps :
76- - run : exit 0
77- ci-failed :
78- name : Complete
79- runs-on : ubuntu-latest
80- needs : [test, i586, no_std, fmt]
81- if : failure()
82- steps :
83- - run : exit 1
82+ # Manually check the status of all dependencies. `if: failure()` does not work.
83+ - name : check if any dependency failed
84+ run : jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'
Original file line number Diff line number Diff line change @@ -28,16 +28,17 @@ jobs:
2828 - uses : actions/checkout@v4
2929 - run : cargo fmt --all --check
3030
31- ci-success :
32- name : Complete
31+ # One job that "summarizes" the success state of this pipeline. This can then be added to branch
32+ # protection, rather than having to add each job separately.
33+ success :
34+ name : Success
3335 runs-on : ubuntu-latest
3436 needs : [test, fmt]
37+ # Github branch protection is exceedingly silly and treats "jobs skipped because a dependency
38+ # failed" as success. So we have to do some contortions to ensure the job fails if any of its
39+ # dependencies fails.
40+ if : always() # make sure this is never "skipped"
3541 steps :
36- - run : exit 0
37- ci-failed :
38- name : Complete
39- runs-on : ubuntu-latest
40- needs : [test, fmt]
41- if : failure()
42- steps :
43- - run : exit 1
42+ # Manually check the status of all dependencies. `if: failure()` does not work.
43+ - name : check if any dependency failed
44+ run : jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'
You can’t perform that action at this time.
0 commit comments