Skip to content

Commit

Permalink
ci: Switch from bors to merge queues
Browse files Browse the repository at this point in the history
The success job is copied from how rust-lang/miri-test-libstd does it.
  • Loading branch information
cuviper committed Feb 6, 2024
1 parent a78ab81 commit 4c906e0
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 16 deletions.
21 changes: 16 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
name: CI
on:
push:
branches:
- staging
- trying
on: merge_group

jobs:

Expand Down Expand Up @@ -48,3 +44,18 @@ jobs:
with:
components: rustfmt
- run: cargo fmt --all --check

# One job that "summarizes" the success state of this pipeline. This can then be added to branch
# protection, rather than having to add each job separately.
success:
name: Success
runs-on: ubuntu-latest
needs: [test, no_std, fmt]
# Github branch protection is exceedingly silly and treats "jobs skipped because a dependency
# failed" as success. So we have to do some contortions to ensure the job fails if any of its
# dependencies fails.
if: always() # make sure this is never "skipped"
steps:
# Manually check the status of all dependencies. `if: failure()` does not work.
- name: check if any dependency failed
run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'
15 changes: 15 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,18 @@ jobs:
with:
components: rustfmt
- run: cargo fmt --all --check

# One job that "summarizes" the success state of this pipeline. This can then be added to branch
# protection, rather than having to add each job separately.
success:
name: Success
runs-on: ubuntu-latest
needs: [test, fmt]
# Github branch protection is exceedingly silly and treats "jobs skipped because a dependency
# failed" as success. So we have to do some contortions to ensure the job fails if any of its
# dependencies fails.
if: always() # make sure this is never "skipped"
steps:
# Manually check the status of all dependencies. `if: failure()` does not work.
- name: check if any dependency failed
run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ name = "num-complex"
repository = "https://github.com/rust-num/num-complex"
version = "0.4.4"
readme = "README.md"
exclude = ["/bors.toml", "/ci/*", "/.github/*"]
exclude = ["/ci/*", "/.github/*"]
edition = "2018"

[package.metadata.docs.rs]
Expand Down
10 changes: 0 additions & 10 deletions bors.toml

This file was deleted.

0 comments on commit 4c906e0

Please sign in to comment.