Skip to content

Commit 3e62ac7

Browse files
authored
Merge pull request rust-lang#614 from Kobzol/ci-success
Add CI success job
2 parents 9f33f84 + bc6b9bf commit 3e62ac7

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

.github/workflows/ci.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,3 +121,23 @@ jobs:
121121
run: |
122122
cd build_system
123123
cargo test
124+
125+
126+
# Summary job for the merge queue.
127+
# ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
128+
success:
129+
needs: [build, duplicates, build_system]
130+
# We need to ensure this job does *not* get skipped if its dependencies fail,
131+
# because a skipped job is considered a success by GitHub. So we have to
132+
# overwrite `if:`. We use `!cancelled()` to ensure the job does still not get run
133+
# when the workflow is canceled manually.
134+
if: ${{ !cancelled() }}
135+
runs-on: ubuntu-latest
136+
steps:
137+
# Manually check the status of all dependencies. `if: failure()` does not work.
138+
- name: Conclusion
139+
run: |
140+
# Print the dependent jobs to see them in the CI log
141+
jq -C <<< '${{ toJson(needs) }}'
142+
# Check if all jobs that we depend on (in the needs array) were successful.
143+
jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'

0 commit comments

Comments
 (0)