diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 7c88a30..191a249 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -46,24 +46,48 @@ jobs: - name: Check run: cargo check --all-features - audit: - name: Security Audit + ensure_no_std: + name: Ensure no_std runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Install Rust Toolchain + - name: Install Rust Toolchain (nightly) + uses: dtolnay/rust-toolchain@nightly + with: + targets: thumbv6m-none-eabi + + - name: Build (no_std) + run: cargo build --no-default-features --target thumbv6m-none-eabi + shell: bash + + coverage: + name: Coverage + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Install Rust Toolchain (stable) uses: dtolnay/rust-toolchain@stable + with: + components: llvm-tools-preview - - name: Install cargo-audit - run: cargo install cargo-audit + - name: Install cargo-llvm-cov + run: cargo install cargo-llvm-cov - - name: Run cargo audit - run: cargo audit + - name: Run coverage + run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info - ensure_no_std: - name: Ensure no_std + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4 + with: + files: lcov.info + fail_ci_if_error: false + + audit: + name: Security Audit runs-on: ubuntu-latest steps: @@ -72,5 +96,8 @@ jobs: - name: Install Rust Toolchain uses: dtolnay/rust-toolchain@stable - - name: Build no_std - run: cargo build --no-default-features + - name: Install cargo-audit + run: cargo install cargo-audit + + - name: Run cargo audit + run: cargo audit