From 1406e49a120fcaf264460b17cf186a6817d587d6 Mon Sep 17 00:00:00 2001 From: Richard Zak Date: Sat, 2 Mar 2024 14:34:37 -0500 Subject: [PATCH] ci: don't use the unmaintained `actions-rs` actions Signed-off-by: Richard Zak --- .github/workflows/lint.yml | 34 +++++++++------------------------- .github/workflows/test.yml | 11 +++-------- ciborium-ll/src/lib.rs | 4 ++-- ciborium/tests/tag.rs | 4 ++-- 4 files changed, 16 insertions(+), 37 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 03ddb63..2fe3278 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -6,43 +6,27 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - components: rustfmt - toolchain: stable - profile: minimal - override: true - - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check + - name: Setup Rust toolchain + run: rustup show && rustup update + - name: cargo fmt + run: cargo fmt --all -- --check clippy: name: cargo clippy runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - components: clippy - toolchain: stable - profile: minimal - override: true - - uses: actions-rs/cargo@v1 - with: - command: clippy - args: -- -D warnings + - name: Setup Rust toolchain + run: rustup show && rustup update + - name: cargo clippy + run: cargo clippy --workspace --all-features --tests -- -D warnings readme: name: cargo readme runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - profile: minimal - override: true + - uses: dtolnay/rust-toolchain@stable - run: cargo install cargo-readme - run: cd ciborium-io && cargo readme > README.md - run: cd ciborium-ll && cargo readme > README.md diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 750aa66..eaeb114 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,14 +6,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - toolchain: ${{ matrix.toolchain }} - override: true - - uses: actions-rs/cargo@v1 - with: - command: test - args: --manifest-path=${{ matrix.crates.name }}/Cargo.toml ${{ matrix.profile.flag }} --no-default-features --features=${{ matrix.crates.feat }} + - uses: dtolnay/rust-toolchain@${{ matrix.toolchain }} + - name: cargo test + run: cargo test --manifest-path=${{ matrix.crates.name }}/Cargo.toml ${{ matrix.profile.flag }} --no-default-features --features=${{ matrix.crates.feat }} strategy: fail-fast: false matrix: diff --git a/ciborium-ll/src/lib.rs b/ciborium-ll/src/lib.rs index c02ba49..5b47ba9 100644 --- a/ciborium-ll/src/lib.rs +++ b/ciborium-ll/src/lib.rs @@ -472,8 +472,8 @@ mod tests { // Test decoding let mut decoder = Decoder::from(&bytes[..]); - for header in headers.iter().cloned() { - assert_eq!(header, decoder.pull().unwrap()); + for header in headers.iter() { + assert_eq!(*header, decoder.pull().unwrap()); } // Test encoding diff --git a/ciborium/tests/tag.rs b/ciborium/tests/tag.rs index c19ee00..4664d57 100644 --- a/ciborium/tests/tag.rs +++ b/ciborium/tests/tag.rs @@ -43,7 +43,7 @@ fn test( match from_reader(&bytes[..]) { Ok(x) if success => assert_eq!(item, x), Ok(..) => panic!("unexpected success"), - Err(e) if success => Err(e).unwrap(), + Err(e) if success => panic!("{:?}", e), Err(..) => (), } @@ -51,7 +51,7 @@ fn test( match value.deserialized() { Ok(x) if success => assert_eq!(item, x), Ok(..) => panic!("unexpected success"), - Err(e) if success => Err(e).unwrap(), + Err(e) if success => panic!("{:?}", e), Err(..) => (), } }