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 50ecdb1 commit 9402e48
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 14 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 @@ -43,3 +39,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-derive"
repository = "https://github.com/rust-num/num-derive"
version = "0.4.1"
readme = "README.md"
exclude = ["/bors.toml", "/ci/*", "/.github/*"]
exclude = ["/ci/*", "/.github/*"]
edition = "2021"
rust-version = "1.56.0"

Expand Down
8 changes: 0 additions & 8 deletions bors.toml

This file was deleted.

0 comments on commit 9402e48

Please sign in to comment.