Skip to content

Commit 81e6404

Browse files
authored
Merge pull request #569 from Kobzol/ci-check-success
CI: add a success conclusion job
2 parents da4d3dd + 6031a71 commit 81e6404

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

.github/workflows/main.yml

+15
Original file line numberDiff line numberDiff line change
@@ -128,3 +128,18 @@ jobs:
128128
run: |
129129
rustup set profile minimal && rustup default "nightly-$(curl -s https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/clippy)" && rustup component add clippy
130130
- run: cargo clippy -- -D clippy::all
131+
132+
success:
133+
needs:
134+
- test
135+
- rustfmt
136+
- clippy
137+
runs-on: ubuntu-latest
138+
# GitHub branch protection is exceedingly silly and treats "jobs skipped because a dependency
139+
# failed" as success. So we have to do some contortions to ensure the job fails if any of its
140+
# dependencies fails.
141+
if: always() # make sure this is never "skipped"
142+
steps:
143+
# Manually check the status of all dependencies. `if: failure()` does not work.
144+
- name: check if any dependency failed
145+
run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'

0 commit comments

Comments
 (0)