forked from bitcoindevkit/bdk_wallet
-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (46 loc) · 1.67 KB
/
code_coverage.yml
File metadata and controls
51 lines (46 loc) · 1.67 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
48
49
50
51
name: Code Coverage
# Generates code coverage reports using cargo-llvm-cov and uploads results to Codecov.
# Runs on every push and pull request to track test coverage metrics.
# Uploads coverage data to Codecov for tracking and produces an HTML report artifact for download.
on: [push, pull_request]
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 Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly
components: llvm-tools-preview
cache: true
- name: Install cargo-llvm-cov
run: cargo install cargo-llvm-cov
- name: Generate coverage data
run: cargo llvm-cov --all-features --branch --quiet --ignore-filename-regex "test_utils" --lcov --output-path lcov.info
env:
RUSTFLAGS: "--cfg coverage_nightly"
- name: Generate HTML coverage report
run: cargo llvm-cov --all-features --branch --quiet --ignore-filename-regex "test_utils" --html
env:
RUSTFLAGS: "--cfg coverage_nightly"
- name: Codecov upload
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
with:
files: ./lcov.info
flags: rust
name: codecov-bdk-wallet
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
- name: Upload artifact
uses: actions/upload-artifact@v6
with:
name: coverage-report
path: target/llvm-cov/html