diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4e5b22b..b36681d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -74,6 +74,30 @@ jobs: # feature nothing compiles is a feature that breaks at release time. - run: cargo test --tests --features emulation + # Coverage is additive and NON-REQUIRED: it uploads to Codecov but never + # gates a merge (fail_ci_if_error is false, and it is not wired into any + # release gate). It mirrors the `test` job's environment — same pinned + # toolchain, ubuntu-latest, no `if:` so it runs on every branch and PR just + # as `test` does. `--locked` is intentionally omitted to match this crate's + # policy (Cargo.lock is gitignored; --locked would fail without it). + coverage: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + - uses: dtolnay/rust-toolchain@1.90.0 + with: + components: llvm-tools-preview + - uses: Swatinem/rust-cache@v2 + with: + shared-key: freemkv-unlock-coverage + - uses: taiki-e/install-action@cargo-llvm-cov + - run: cargo llvm-cov --workspace --lcov --output-path lcov.info + - uses: codecov/codecov-action@v5 + with: + files: lcov.info + slug: freemkv/freemkv-unlock + fail_ci_if_error: false + # The crate ships on macOS and Windows through its consumers, so it has to # compile there. Build the tests (not just `cargo check`) — that forces # codegen and catches errors in test-only code, which `check` skips. diff --git a/README.md b/README.md index cb93b04..cc95989 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # freemkv-unlock +[![codecov](https://codecov.io/gh/freemkv/freemkv-unlock/branch/dev/graph/badge.svg)](https://codecov.io/gh/freemkv/freemkv-unlock) + The unlock layer for the freemkv toolchain. An **unlocker removes a drive-level bus-encryption barrier** so the drive serves diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000..02c7e1e --- /dev/null +++ b/codecov.yml @@ -0,0 +1,16 @@ +coverage: + status: + project: + default: + informational: true + patch: + default: + informational: true + +comment: false + +ignore: + - "tests" + - "**/tests" + - "benches" + - "examples"