E8: add code coverage to CI
CI had no coverage measurement, and although .gitignore listed coverage artefacts nothing produced them. Add a `coverage` job that runs cargo-llvm-cov over the three pure-Rust crates (with wickra-data's live-binance feature so the Binance parser tests count), emits lcov, and uploads to Codecov. The Codecov upload uses fail_ci_if_error: false so a Codecov outage cannot break CI. Both new actions (taiki-e/install-action, codecov/codecov-action) are SHA-pinned. Add a coverage badge to the README.
This commit is contained in:
@@ -86,6 +86,41 @@ jobs:
|
||||
- name: Test on MSRV
|
||||
run: cargo test ${{ matrix.packages }} --verbose
|
||||
|
||||
# Code coverage for the pure-Rust crates, uploaded to Codecov.
|
||||
coverage:
|
||||
name: Coverage
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
|
||||
|
||||
- name: Install Rust toolchain
|
||||
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable branch, 2026-03-27
|
||||
with:
|
||||
components: llvm-tools-preview
|
||||
|
||||
- name: Cache cargo
|
||||
uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
|
||||
|
||||
- name: Install cargo-llvm-cov
|
||||
uses: taiki-e/install-action@e0eafa9a0d485c37f97c0f7beb930a58a2facbac # v2.79.4
|
||||
with:
|
||||
tool: cargo-llvm-cov
|
||||
|
||||
- name: Generate coverage (lcov)
|
||||
run: >
|
||||
cargo llvm-cov
|
||||
-p wickra-core -p wickra -p wickra-data
|
||||
--features wickra-data/live-binance
|
||||
--lcov --output-path lcov.info
|
||||
|
||||
- name: Upload to Codecov
|
||||
uses: codecov/codecov-action@75cd11691c0faa626561e295848008c8a7dddffe # v5.5.4
|
||||
with:
|
||||
files: lcov.info
|
||||
fail_ci_if_error: false
|
||||
env:
|
||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||
|
||||
# Supply-chain audit: security advisories, license policy, banned crates,
|
||||
# and source restrictions. Configured by deny.toml at the repo root.
|
||||
supply-chain:
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
# Wickra
|
||||
|
||||
[](https://github.com/kingchenc/wickra/actions/workflows/ci.yml)
|
||||
[](https://codecov.io/gh/kingchenc/wickra)
|
||||
[](https://crates.io/crates/wickra)
|
||||
[](https://pypi.org/project/wickra/)
|
||||
[](https://www.npmjs.com/package/wickra)
|
||||
|
||||
Reference in New Issue
Block a user