Skip to content

Commit 615822d

Browse files
committed
Switch CI to merge queues
1 parent d47e254 commit 615822d

File tree

1 file changed

+16
-23
lines changed
  • src/tools/miri/.github/workflows

1 file changed

+16
-23
lines changed

src/tools/miri/.github/workflows/ci.yml

+16-23
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
name: CI
22

33
on:
4-
push:
5-
# Run in PRs and for bors, but not on master.
6-
branches:
7-
- 'auto'
8-
- 'try'
4+
merge_group:
95
pull_request:
106
branches:
117
- 'master'
@@ -68,27 +64,24 @@ jobs:
6864
- name: rustdoc
6965
run: RUSTDOCFLAGS="-Dwarnings" ./miri doc --document-private-items
7066

71-
# These jobs doesn't actually test anything, but they're only used to tell
72-
# bors the build completed, as there is no practical way to detect when a
73-
# workflow is successful listening to webhooks only.
74-
#
75-
# ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
76-
end-success:
77-
name: bors build finished
78-
runs-on: ubuntu-latest
67+
conclusion:
7968
needs: [build, style]
80-
if: github.event.pusher.name == 'bors' && success()
81-
steps:
82-
- name: mark the job as a success
83-
run: exit 0
84-
end-failure:
85-
name: bors build finished
69+
# We need to ensure this job does *not* get skipped if its dependencies fail,
70+
# because a skipped job is considered a success by GitHub. So we have to
71+
# overwrite `if:`. We use `!cancelled()` to ensure the job does still not get run
72+
# when the workflow is canceled manually.
73+
#
74+
# ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
75+
if: ${{ !cancelled() }}
8676
runs-on: ubuntu-latest
87-
needs: [build, style]
88-
if: github.event.pusher.name == 'bors' && (failure() || cancelled())
8977
steps:
90-
- name: mark the job as a failure
91-
run: exit 1
78+
# Manually check the status of all dependencies. `if: failure()` does not work.
79+
- name: Conclusion
80+
run: |
81+
# Print the dependent jobs to see them in the CI log
82+
jq -C <<< '${{ toJson(needs) }}'
83+
# Check if all jobs that we depend on (in the needs array) were successful.
84+
jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'
9285
9386
cron-fail-notify:
9487
name: cronjob failure notification

0 commit comments

Comments
 (0)