Merge pull request #569 from Kobzol/ci-check-success

CI: add a success conclusion job
This commit is contained in:
Amanieu d'Antras 2024-01-26 02:37:28 +00:00 committed by GitHub
commit bb30119076
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -128,3 +128,18 @@ jobs:
run: |
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
- run: cargo clippy -- -D clippy::all
success:
needs:
- test
- rustfmt
- clippy
runs-on: ubuntu-latest
# GitHub branch protection is exceedingly silly and treats "jobs skipped because a dependency
# failed" as success. So we have to do some contortions to ensure the job fails if any of its
# dependencies fails.
if: always() # make sure this is never "skipped"
steps:
# Manually check the status of all dependencies. `if: failure()` does not work.
- name: check if any dependency failed
run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'