Merge pull request #3981 from Kobzol/ci-merge-queue

Switch CI to merge queues
This commit is contained in:
Marco Ieni 2024-10-22 11:03:36 +00:00 committed by GitHub
commit 340d2f7847
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,11 +1,7 @@
name: CI
on:
push:
# Run in PRs and for bors, but not on master.
branches:
- 'auto'
- 'try'
merge_group:
pull_request:
branches:
- 'master'
@ -62,27 +58,24 @@ jobs:
- name: rustdoc
run: RUSTDOCFLAGS="-Dwarnings" ./miri doc --document-private-items
# These jobs doesn't actually test anything, but they're only used to tell
# bors the build completed, as there is no practical way to detect when a
# workflow is successful listening to webhooks only.
#
# ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
end-success:
name: bors build finished
runs-on: ubuntu-latest
conclusion:
needs: [build, style]
if: github.event.pusher.name == 'bors' && success()
steps:
- name: mark the job as a success
run: exit 0
end-failure:
name: bors build finished
# We need to ensure this job does *not* get skipped if its dependencies fail,
# because a skipped job is considered a success by GitHub. So we have to
# overwrite `if:`. We use `!cancelled()` to ensure the job does still not get run
# when the workflow is canceled manually.
#
# ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
if: ${{ !cancelled() }}
runs-on: ubuntu-latest
needs: [build, style]
if: github.event.pusher.name == 'bors' && (failure() || cancelled())
steps:
- name: mark the job as a failure
run: exit 1
# Manually check the status of all dependencies. `if: failure()` does not work.
- name: Conclusion
run: |
# Print the dependent jobs to see them in the CI log
jq -C <<< '${{ toJson(needs) }}'
# Check if all jobs that we depend on (in the needs array) were successful.
jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'
cron-fail-notify:
name: cronjob failure notification