Skip to content

Commit 249413e

Browse files
committed
Merge bitcoindevkit#2144: ci: switch from coveralls to codecov for coverage reporting
2a42f25 ci(coverage): use `codecov` instead of `coveralls` (Shubham Shinde) Pull request description: closes bitcoindevkit#2093 ### Description Migrates code coverage reporting from Coveralls to Codecov. - **Replaced coverage service**: Switched from `coverallsapp/github-action` to `codecov/codecov-action@v5.5.2` (pinned commit SHA for security) - **Added permissions**: Added `contents: read` and `pull-requests: write` to enable Codecov PR comments - **Codecov configuration**: Added `flags: rust` and `name: codecov-bdk` for better organization ### Changelog notice ``` ### Changed - chore(ci): switch from coveralls to codecov ``` #### All Submissions: * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md) ACKs for top commit: oleonardolima: self-ACK 2a42f25 notmandatory: ACK 2a42f25 Tree-SHA512: 53dd898fefb973fc4a884fbfb34335d5f03992d30c676841b66db8dcc5a4d3a8e5178d5886cb91308df873f25fe6703457dc27aa5b45451f828bfcded612cace
2 parents 641b400 + 2a42f25 commit 249413e

1 file changed

Lines changed: 31 additions & 18 deletions

File tree

Lines changed: 31 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
1-
on: [push, pull_request]
2-
31
name: Code Coverage
42

5-
permissions: {}
3+
# Generates code coverage reports using cargo-llvm-cov and uploads results to Codecov.
4+
# Runs on every push and pull request to track test coverage metrics.
5+
# Uploads coverage data to Codecov for tracking and produces an HTML report artifact for download.
6+
7+
on: [push, pull_request]
8+
9+
permissions:
10+
contents: read
11+
pull-requests: write
612

713
jobs:
8-
Codecov:
14+
Coverage:
915
name: Code Coverage
1016
runs-on: ubuntu-latest
17+
1118
steps:
1219
- name: Checkout
1320
uses: actions/checkout@v6
@@ -18,24 +25,30 @@ jobs:
1825
- name: Install Rust toolchain
1926
uses: actions-rust-lang/setup-rust-toolchain@v1
2027
with:
21-
toolchain: nightly-2025-11-27
22-
override: true
23-
cache: true
24-
components: llvm-tools-preview
28+
toolchain: nightly-2025-11-27
29+
components: llvm-tools-preview
30+
# override: true
31+
cache: true
2532
- name: Install cargo-llvm-cov
26-
run: if [[ ! -e ~/.cargo/bin/cargo-llvm-cov ]]; then cargo install cargo-llvm-cov; fi
27-
- name: Make coverage directory
28-
run: mkdir coverage
29-
- name: Test and report coverage
30-
run: cargo llvm-cov -q --doctests --branch --all --ignore-filename-regex "(example*|crates/testenv/*)" --all-features --lcov --output-path ./coverage/lcov.info
33+
run: cargo install cargo-llvm-cov
34+
- name: Generate coverage data
35+
run: cargo llvm-cov --all --all-features --branch --quiet --doctests --ignore-filename-regex "(example*|crates/testenv/*)" --lcov --output-path lcov.info
36+
env:
37+
RUSTFLAGS: "--cfg coverage_nightly"
3138
- name: Generate HTML coverage report
32-
run: genhtml -o coverage-report.html --ignore-errors unmapped ./coverage/lcov.info
33-
- name: Coveralls upload
34-
uses: coverallsapp/github-action@master
39+
run: cargo llvm-cov --all --all-features --branch --quiet --doctests --ignore-filename-regex "(example*|crates/testenv/*)" --html
40+
env:
41+
RUSTFLAGS: "--cfg coverage_nightly"
42+
- name: Codecov upload
43+
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
3544
with:
36-
github-token: ${{ secrets.GITHUB_TOKEN }}
45+
files: ./lcov.info
46+
flags: rust
47+
name: codecov-bdk
48+
token: ${{ secrets.CODECOV_TOKEN }}
49+
fail_ci_if_error: false
3750
- name: Upload artifact
3851
uses: actions/upload-artifact@v7
3952
with:
4053
name: coverage-report
41-
path: coverage-report.html
54+
path: target/llvm-cov/html

0 commit comments

Comments
 (0)