11name : CI
22
33on :
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'
3834 # The `style` job only runs on Linux; this makes sure the Windows-host-specific
3935 # code is also covered by clippy.
4036 - name : Check clippy
41- if : matrix.os == 'windows-latest'
37+ if : ${{ matrix.os == 'windows-latest' }}
4238 run : ./miri clippy -- -D warnings
4339
4440 - name : Test Miri
@@ -62,27 +58,25 @@ 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- #
61+ # Summary job for the merge queue.
6962 # 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 :
7365 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() }}
8071 runs-on : ubuntu-latest
81- needs : [build, style]
82- if : github.event.pusher.name == 'bors' && (failure() || cancelled())
8372 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) }}'
8680
8781 cron-fail-notify :
8882 name : cronjob failure notification
9387 # ... and create a PR.
9488 pull-requests : write
9589 needs : [build, style]
96- if : github.event_name == 'schedule' && failure()
90+ if : ${{ github.event_name == 'schedule' && failure() }}
9791 steps :
9892 # Send a Zulip notification
9993 - name : Install zulip-send
@@ -145,7 +139,7 @@ jobs:
145139 git push -u origin $BRANCH
146140 - name : Create Pull Request
147141 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. ')
149143 ~/.local/bin/zulip-send --user $ZULIP_BOT_EMAIL --api-key $ZULIP_API_TOKEN --site https://rust-lang.zulipchat.com \
150144 --stream miri --subject "Miri Build Failure ($(date -u +%Y-%m))" \
151145 --message "A PR doing a rustc-pull [has been automatically created]($PR) for your convenience."
0 commit comments