Skip to content

Commit

Permalink
ci: All jobs should pass for CI to pass
Browse files Browse the repository at this point in the history
This change makes it so that CI does not pass unless all jobs defined in
the workflow file pass. This is necessary in order to prevent landing
changes that break CI jobs. `success()` and `failure()` which were used
before do not take into account dependent jobs.
  • Loading branch information
mrobinson committed Apr 3, 2024
1 parent 9b94335 commit 440594f
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,6 @@ jobs:
- run: cargo check --lib --all-features

build_result:
name: Result
runs-on: ubuntu-latest
needs:
- "ci"

steps:
- name: Mark the job as successful
run: exit 0
if: success()
- name: Mark the job as unsuccessful
run: exit 1
if: ${{ !success() }}

lint:
name: Lint
runs-on: ubuntu-latest
Expand All @@ -86,3 +72,20 @@ jobs:

- name: Run clippy
run: cargo clippy --all-features --all-targets -- -D warnings

build_result:
name: Result
runs-on: ubuntu-latest
needs:
- ci
- lint
- msrv

steps:
- name: Success
if: ${{ !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') }}
run: exit 0
- name: Failure
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
run: exit 1

0 comments on commit 440594f

Please sign in to comment.