Skip to content

Commit 340d2f7

Browse files
authored
Merge pull request rust-lang#3981 from Kobzol/ci-merge-queue
Switch CI to merge queues
2 parents f8448f9 + 615822d commit 340d2f7

File tree

1 file changed

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

1 file changed

+16
-23
lines changed

Diff for: 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'
@@ -62,27 +58,24 @@ jobs:
6258
- name: rustdoc
6359
run: RUSTDOCFLAGS="-Dwarnings" ./miri doc --document-private-items
6460

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

0 commit comments

Comments
 (0)