Skip to content

Commit

Permalink
Update Github actions to use dtolnay/rust-toolchain.
Browse files Browse the repository at this point in the history
`actions-rs` is no longer maintained. Resolves #314.
  • Loading branch information
iliekturtles committed Jun 26, 2023
1 parent fe33480 commit 7a0dfde
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 77 deletions.
36 changes: 9 additions & 27 deletions .github/workflows/ci-full-test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,15 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Install Rust toolchain
id: install-rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
uses: dtolnay/rust-toolchain@stable

# Cache based on OS/compiler.
- name: Extract cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
~/.cargo
Expand All @@ -30,34 +27,19 @@ jobs:
target
!target/tests
!target/examples
key: ${{ runner.os }}-${{ steps.install-rust.outputs.rustc_hash }}
key: ${{ runner.os }}-${{ steps.install-rust.outputs.cachekey }}

- name: Test all crates
uses: actions-rs/cargo@v1
with:
command: test
args: --all --verbose --features "use_serde"
run: cargo test --all --verbose --features "use_serde"

- name: Test si
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose --no-default-features --features "f32 si"
run: cargo test --verbose --no-default-features --features "f32 si"

- name: Test all non-storage type features
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose --no-default-features --features "autoconvert f32 si use_serde"
run: cargo test --verbose --no-default-features --features "autoconvert f32 si use_serde"

- name: Test si with underlying storage types
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose --no-run --no-default-features --features "autoconvert usize isize bigint bigrational complex32 si std use_serde"
run: cargo test --verbose --no-run --no-default-features --features "autoconvert usize isize bigint bigrational complex32 si std use_serde"

- name: Test all non-si features
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose --no-run --no-default-features --features "autoconvert usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 bigint biguint rational rational32 rational64 bigrational complex32 complex64 f32 f64 std use_serde"
run: cargo test --verbose --no-run --no-default-features --features "autoconvert usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 bigint biguint rational rational32 rational64 bigrational complex32 complex64 f32 f64 std use_serde"
29 changes: 5 additions & 24 deletions .github/workflows/ci-min-test-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ jobs:
runs-on: ${{ matrix.os }}
env:
RUSTFLAGS: -D warnings
CARGO_NET_GIT_FETCH_WITH_CLI: ${{ matrix.cli_fetch }}

strategy:
fail-fast: false # If one job fails, run remaining jobs.
Expand All @@ -16,38 +15,20 @@ jobs:
- ubuntu-latest
- macOS-latest
- windows-latest
rust:
toolchain:
- stable
- beta
- nightly
- 1.60.0 # MSRV
exclude:
- os: ubuntu-latest
rust: stable
- os: macOS-latest
rust: 1.60.0
include: # https://github.com/rust-lang/cargo/issues/10303
- cli_fetch: false
- os: ubuntu-latest
rust: 1.60.0
cli_fetch: true

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Install Rust toolchain
id: install-rust
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true

# Skip cache, workflow runs in ~5 minutes.
toolchain: ${{ matrix.toolchain }}

- name: Test all crates
uses: actions-rs/cargo@v1
with:
command: test
args: --all --verbose --features "use_serde"
run: cargo test --all --verbose --features "use_serde"
41 changes: 15 additions & 26 deletions .github/workflows/ci-tool-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,17 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:
profile: minimal
toolchain: ${{ matrix.toolchain }}
override: true
components: rustfmt, clippy

# Tools-specific cache based on OS/compiler.
- name: Extract tools cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
~/.cargo
Expand All @@ -34,34 +32,25 @@ jobs:
target
!target/tests
!target/examples
key: tools-${{ runner.os }}-${{ steps.install-rust.outputs.rustc_hash }}
key: tools-${{ runner.os }}-${{ steps.install-rust.outputs.cachekey }}

- name: Clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all --tests -- -D warnings
run: cargo clippy --all --tests -- -D warnings

- name: Rustfmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
run: cargo fmt --all -- --check

- name: Rustdoc
uses: actions-rs/cargo@v1
with:
command: doc
args: --all --no-deps
run: cargo doc --all --no-deps
env:
RUSTDOCFLAGS: '-D warnings'

- name: Run tarpaulin
uses: actions-rs/tarpaulin@v0.1
if: ${{ success() && github.event_name == 'push' }}
# - name: Run tarpaulin
# uses: actions-rs/tarpaulin@v0.1
# if: ${{ success() && github.event_name == 'push' }}

- name: Upload to codecov.io
uses: codecov/codecov-action@v1.0.2
if: ${{ success() && github.event_name == 'push' }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
# - name: Upload to codecov.io
# uses: codecov/codecov-action@v1.0.2
# if: ${{ success() && github.event_name == 'push' }}
# with:
# token: ${{ secrets.CODECOV_TOKEN }}

0 comments on commit 7a0dfde

Please sign in to comment.