Skip to content

Commit 9162696

Browse files
committed
ci: Switch from bors to merge queues
The success job is copied from how rust-lang/miri-test-libstd does it.
1 parent 3674819 commit 9162696

File tree

4 files changed

+32
-19
lines changed

4 files changed

+32
-19
lines changed

.github/workflows/ci.yaml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
name: CI
2-
on:
3-
push:
4-
branches:
5-
- staging
6-
- trying
2+
on: merge_group
73

84
jobs:
95

@@ -65,3 +61,18 @@ jobs:
6561
with:
6662
components: rustfmt
6763
- run: cargo fmt --all --check
64+
65+
# One job that "summarizes" the success state of this pipeline. This can then be added to branch
66+
# protection, rather than having to add each job separately.
67+
success:
68+
name: Success
69+
runs-on: ubuntu-latest
70+
needs: [test, i686, no_std, fmt]
71+
# Github branch protection is exceedingly silly and treats "jobs skipped because a dependency
72+
# failed" as success. So we have to do some contortions to ensure the job fails if any of its
73+
# dependencies fails.
74+
if: always() # make sure this is never "skipped"
75+
steps:
76+
# Manually check the status of all dependencies. `if: failure()` does not work.
77+
- name: check if any dependency failed
78+
run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'

.github/workflows/pr.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,18 @@ jobs:
2727
with:
2828
components: rustfmt
2929
- run: cargo fmt --all --check
30+
31+
# One job that "summarizes" the success state of this pipeline. This can then be added to branch
32+
# protection, rather than having to add each job separately.
33+
success:
34+
name: Success
35+
runs-on: ubuntu-latest
36+
needs: [test, fmt]
37+
# Github branch protection is exceedingly silly and treats "jobs skipped because a dependency
38+
# failed" as success. So we have to do some contortions to ensure the job fails if any of its
39+
# dependencies fails.
40+
if: always() # make sure this is never "skipped"
41+
steps:
42+
# Manually check the status of all dependencies. `if: failure()` does not work.
43+
- name: check if any dependency failed
44+
run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ repository = "https://github.com/rust-num/num-bigint"
1111
version = "0.4.4"
1212
readme = "README.md"
1313
build = "build.rs"
14-
exclude = ["/bors.toml", "/ci/*", "/.github/*"]
14+
exclude = ["/ci/*", "/.github/*"]
1515
edition = "2018"
1616

1717
[features]

bors.toml

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)