Skip to content

Commit 7c315cf

Browse files
committed
Switch CI from bors to merge queues
1 parent 919ba41 commit 7c315cf

File tree

1 file changed

+17
-20
lines changed
  • src/tools/rust-analyzer/.github/workflows

1 file changed

+17
-20
lines changed

src/tools/rust-analyzer/.github/workflows/ci.yaml

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
1-
# Please make sure that the `needs` fields for both `end-success` and `end-failure`
1+
# Please make sure that the `needs` field for the `conclusion` job
22
# are updated when adding new jobs!
33

44
name: CI
55
on:
66
pull_request:
7-
push:
8-
branches:
9-
- auto
10-
- try
11-
- automation/bors/try
7+
merge_group:
128

139
env:
1410
CARGO_INCREMENTAL: 0
@@ -237,20 +233,21 @@ jobs:
237233
- name: check for typos
238234
run: typos
239235

240-
end-success:
241-
name: bors build finished
242-
if: github.event.pusher.name == 'bors' && success()
243-
runs-on: ubuntu-latest
236+
conclusion:
244237
needs: [rust, rust-cross, typescript, typo-check]
245-
steps:
246-
- name: Mark the job as successful
247-
run: exit 0
248-
249-
end-failure:
250-
name: bors build finished
251-
if: github.event.pusher.name == 'bors' && !success()
238+
# We need to ensure this job does *not* get skipped if its dependencies fail,
239+
# because a skipped job is considered a success by GitHub. So we have to
240+
# overwrite `if:`. We use `!cancelled()` to ensure the job does still not get run
241+
# when the workflow is canceled manually.
242+
#
243+
# ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
244+
if: ${{ !cancelled() }}
252245
runs-on: ubuntu-latest
253-
needs: [rust, rust-cross, typescript, typo-check]
254246
steps:
255-
- name: Mark the job as a failure
256-
run: exit 1
247+
# Manually check the status of all dependencies. `if: failure()` does not work.
248+
- name: Conclusion
249+
run: |
250+
# Print the dependent jobs to see them in the CI log
251+
jq -C <<< '${{ toJson(needs) }}'
252+
# Check if all jobs that we depend on (in the needs array) were successful.
253+
jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'

0 commit comments

Comments
 (0)