Skip to content

Commit

Permalink
Merge pull request #120 from cuviper/ci
Browse files Browse the repository at this point in the history
ci: merge queue and registry caching
  • Loading branch information
cuviper authored Feb 6, 2024
2 parents a78ab81 + 7589944 commit d46cf08
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 22 deletions.
32 changes: 24 additions & 8 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 All @@ -21,7 +17,12 @@ jobs:
nightly
]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/cache@v4
if: startsWith(matrix.rust, '1')
with:
path: ~/.cargo/registry/index
key: cargo-${{ matrix.rust }}-git-index
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
Expand All @@ -33,7 +34,7 @@ jobs:
name: No Std
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
target: thumbv6m-none-eabi
Expand All @@ -43,8 +44,23 @@ jobs:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/[email protected]
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) }}'
7 changes: 6 additions & 1 deletion .github/workflows/master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ jobs:
matrix:
rust: [1.31.0, stable]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/cache@v4
if: startsWith(matrix.rust, '1')
with:
path: ~/.cargo/registry/index
key: cargo-${{ matrix.rust }}-git-index
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
Expand Down
24 changes: 22 additions & 2 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ jobs:
matrix:
rust: [1.31.0, stable]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/cache@v4
if: startsWith(matrix.rust, '1')
with:
path: ~/.cargo/registry/index
key: cargo-${{ matrix.rust }}-git-index
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
Expand All @@ -22,8 +27,23 @@ jobs:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/[email protected]
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.

1 change: 1 addition & 0 deletions ci/test_full.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ check_version 1.43 || cargo update -p libm --precise 0.2.5

# Some crates moved to Rust 1.56 / 2021
check_version 1.56 || (
cargo update -p serde --precise 1.0.185
cargo update -p quote --precise 1.0.30
cargo update -p proc-macro2 --precise 1.0.65
cargo update -p rkyv --precise 0.7.40
Expand Down

0 comments on commit d46cf08

Please sign in to comment.