diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 00505be..896b684 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -43,3 +43,24 @@ jobs: with: name: hrv-rs-build path: target/release/ + + - name: Install cargo-tarpaulin + run: cargo install cargo-tarpaulin + + - name: Run Coverage Analysis + run: cargo tarpaulin --out Xml --all-targets --all-features + env: + RUSTFLAGS: "-C link-dead-code" # Required for accurate coverage analysis + + - name: Upload Coverage Report + uses: actions/upload-artifact@v3 + with: + name: coverage-report + path: tarpaulin-report.xml + + - name: Upload to Codecov + uses: codecov/codecov-action@v3 + with: + files: tarpaulin-report.xml + fail_ci_if_error: true + flags: unittests \ No newline at end of file diff --git a/README.md b/README.md index ce9b244..571f3a5 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ # Hrv-rs +[![Pipeline Status](https://github.com/mat-kie/hrv-rs/actions/workflows/ci.yml/badge.svg)](https://github.com/mat-kie/hrv-rs/actions/workflows/ci.yml) +[![Coverage](https://codecov.io/gh/mat-kie/hrv-rs/branch/main/graph/badge.svg?token=YOUR_CODECOV_TOKEN)](https://codecov.io/gh/mat-kie/hrv-rs) + **Hrv-rs** is a Rust-based application designed to analyze Heart Rate Variability (HRV) using Bluetooth Low Energy (BLE) chest straps.