1
1
name : CI
2
2
3
3
on :
4
- push :
5
- # Run in PRs and for bors, but not on master.
6
- branches :
7
- - ' auto'
8
- - ' try'
4
+ merge_group :
9
5
pull_request :
10
6
branches :
11
7
- ' master'
38
34
# The `style` job only runs on Linux; this makes sure the Windows-host-specific
39
35
# code is also covered by clippy.
40
36
- name : Check clippy
41
- if : matrix.os == 'windows-latest'
37
+ if : ${{ matrix.os == 'windows-latest' }}
42
38
run : ./miri clippy -- -D warnings
43
39
44
40
- name : Test Miri
@@ -62,27 +58,25 @@ jobs:
62
58
- name : rustdoc
63
59
run : RUSTDOCFLAGS="-Dwarnings" ./miri doc --document-private-items
64
60
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
- #
61
+ # Summary job for the merge queue.
69
62
# 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
63
+ # And they should be added below in `cron-fail-notify` as well.
64
+ conclusion :
73
65
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
66
+ # We need to ensure this job does *not* get skipped if its dependencies fail,
67
+ # because a skipped job is considered a success by GitHub. So we have to
68
+ # overwrite `if:`. We use `!cancelled()` to ensure the job does still not get run
69
+ # when the workflow is canceled manually.
70
+ if : ${{ !cancelled() }}
80
71
runs-on : ubuntu-latest
81
- needs : [build, style]
82
- if : github.event.pusher.name == 'bors' && (failure() || cancelled())
83
72
steps :
84
- - name : mark the job as a failure
85
- run : exit 1
73
+ # Manually check the status of all dependencies. `if: failure()` does not work.
74
+ - name : Conclusion
75
+ run : |
76
+ # Print the dependent jobs to see them in the CI log
77
+ jq -C <<< '${{ toJson(needs) }}'
78
+ # Check if all jobs that we depend on (in the needs array) were successful.
79
+ jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'
86
80
87
81
cron-fail-notify :
88
82
name : cronjob failure notification
93
87
# ... and create a PR.
94
88
pull-requests : write
95
89
needs : [build, style]
96
- if : github.event_name == 'schedule' && failure()
90
+ if : ${{ github.event_name == 'schedule' && failure() }}
97
91
steps :
98
92
# Send a Zulip notification
99
93
- name : Install zulip-send
@@ -145,7 +139,7 @@ jobs:
145
139
git push -u origin $BRANCH
146
140
- name : Create Pull Request
147
141
run : |
148
- PR=$(gh pr create -B master --title 'Automatic Rustup' --body '')
142
+ PR=$(gh pr create -B master --title 'Automatic Rustup' --body 'Please close and re-open this PR to trigger CI, then enable auto-merge. ')
149
143
~/.local/bin/zulip-send --user $ZULIP_BOT_EMAIL --api-key $ZULIP_API_TOKEN --site https://rust-lang.zulipchat.com \
150
144
--stream miri --subject "Miri Build Failure ($(date -u +%Y-%m))" \
151
145
--message "A PR doing a rustc-pull [has been automatically created]($PR) for your convenience."
0 commit comments