From 403ec925b64fc58c335c670f72c5495680550b3d Mon Sep 17 00:00:00 2001 From: Daniel McCarney Date: Thu, 11 Apr 2024 19:40:47 -0400 Subject: [PATCH] ci: use feature matrix for cargo test Adopts a similar feature matrix approach as the asn1-rs CI. `cargo test` will be run for no default features, default features, and all features. The asn1-rs matrix differs only by having a separate "no std" job that uses `--no-default-features`. Since this crate doesn't offer a std feature we roll this step into the same matrix as the other feature configs. --- .github/workflows/rust.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 59b0f60..fb51eda 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -29,12 +29,17 @@ jobs: test: name: Test Suite runs-on: ubuntu-latest + strategy: + matrix: + features: + - --no-default-features + - --features=default + - --all-features steps: - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable - - run: cargo test - - run: cargo test --all-features - - run: cargo test --no-default-features + - name: Install stable toolchain + uses: dtolnay/rust-toolchain@stable + - run: cargo test ${{ matrix.features }} fmt: name: Rustfmt