Skip to content

Commit

Permalink
CI: add a success conclusion job
Browse files Browse the repository at this point in the history
  • Loading branch information
Kobzol committed Jan 24, 2024
1 parent e829333 commit 6031a71
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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) }}'

0 comments on commit 6031a71

Please sign in to comment.