Skip to content

Commit

Permalink
ci: Adopt conclusion job that summarizes ci status
Browse files Browse the repository at this point in the history
Originally contributed by @messense in pyo3, copied their solution with
thanks.
  • Loading branch information
bluss committed Mar 9, 2024
1 parent fe3eb5a commit d38f120
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion .github/workflows/pr-check.yml → .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ on:
pull_request:
merge_group:

name: CI Check
name: Continuous integration

env:
CARGO_TERM_COLOR: always
Expand All @@ -28,6 +28,7 @@ jobs:
tests:
if: ${{ github.event_name == 'merge_group' }}
runs-on: ubuntu-latest
name: tests/${{ matrix.platform.rust-target }}/${{ matrix.rust }}
strategy:
matrix:
rust:
Expand All @@ -49,6 +50,7 @@ jobs:
cross_test:
if: ${{ github.event_name == 'merge_group' }}
runs-on: ubuntu-latest
name: cross_test/${{ matrix.platform.rust-target }}/${{ matrix.rust }}
strategy:
matrix:
include:
Expand All @@ -67,3 +69,19 @@ jobs:
- name: Install cross
run: cargo install cross
- run: ./scripts/cross-tests.sh "docs" ${{ matrix.rust }} ${{ matrix.target }}

conclusion:
needs:
- clippy
- tests
- cross_test
if: always()
runs-on: ubuntu-latest
steps:
- name: Result
run: |
jq -C <<< "${needs}"
# Check if all needs were successful or skipped.
"$(jq -r 'all(.result as $result | (["success", "skipped"] | contains([$result])))' <<< "${needs}")"
env:
needs: ${{ toJson(needs) }}

0 comments on commit d38f120

Please sign in to comment.