-
Notifications
You must be signed in to change notification settings - Fork 455
47 lines (44 loc) · 1.55 KB
/
code_coverage.yml
File metadata and controls
47 lines (44 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
on: [push, pull_request]
name: Code Coverage
permissions:
contents: read
pull-requests: write
jobs:
Coverage:
name: Code Coverage
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Install lcov tools
run: sudo apt-get install lcov -y
- name: Install Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly-2025-11-27
override: true
cache: true
components: llvm-tools-preview
- name: Install cargo-llvm-cov
run: if [[ ! -e ~/.cargo/bin/cargo-llvm-cov ]]; then cargo install cargo-llvm-cov; fi
- name: Make coverage directory
run: mkdir coverage
- name: Test and report coverage
run: cargo llvm-cov -q --doctests --branch --all --ignore-filename-regex "(example*|crates/testenv/*)" --all-features --lcov --output-path ./coverage/lcov.info
- name: Generate HTML coverage report
run: genhtml -o coverage-report.html --ignore-errors unmapped ./coverage/lcov.info
- name: Codecov upload
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de
with:
files: ./coverage/lcov.info
flags: rust
name: codecov-bdk
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
- name: Upload artifact
uses: actions/upload-artifact@v6
with:
name: coverage-report
path: coverage-report.html