Codecov:
name: Code Coverage
runs-on: ubuntu-latest
- env:
- RUSTFLAGS: "-Cinstrument-coverage"
- RUSTDOCFLAGS: "-Cinstrument-coverage"
- LLVM_PROFILE_FILE: "./target/coverage/%p-%m.profraw"
-
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
- toolchain: stable
+ toolchain: nightly
override: true
profile: minimal
components: llvm-tools-preview
- name: Rust Cache
uses: Swatinem/rust-cache@v2.7.8
- - name: Install grcov
- run: if [[ ! -e ~/.cargo/bin/grcov ]]; then cargo install grcov; fi
- - name: Test
- run: cargo test --all-features
+ - 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: Run grcov
- run: grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --keep-only '**/crates/**' --ignore '**/tests/**' --ignore '**/examples/**' -o ./coverage/lcov.info
+ - name: Test and report coverage
+ run: cargo +nightly 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: Coveralls upload
[workspace.lints.clippy]
print_stdout = "deny"
print_stderr = "deny"
+
+[workspace.lints.rust]
+unexpected_cfgs = { level = "warn", check-cfg = ['cfg(coverage,coverage_nightly)'] }
//! To only get block updates (exclude mempool transactions), the caller can use
//! [`Emitter::next_block`] until it returns `Ok(None)` (which means the chain tip is reached). A
//! separate method, [`Emitter::mempool`] can be used to emit the whole mempool.
+#![cfg_attr(coverage_nightly, feature(coverage_attribute))]
#![warn(missing_docs)]
use bdk_core::{BlockId, CheckPoint};
}
#[cfg(test)]
+#[cfg_attr(coverage_nightly, coverage(off))]
mod test {
use crate::{bitcoincore_rpc::RpcApi, Emitter, NO_EXPECTED_MEMPOOL_TXIDS};
use bdk_chain::local_chain::LocalChain;
}
#[cfg(test)]
+#[cfg_attr(coverage_nightly, coverage(off))]
mod test {
use bdk_core::ConfirmationBlockTime;
)]
#![no_std]
#![warn(missing_docs)]
+#![cfg_attr(coverage_nightly, feature(coverage_attribute))]
pub use bitcoin;
mod balance;
}
#[cfg(test)]
+#[cfg_attr(coverage_nightly, coverage(off))]
mod test {
use super::*;
}
#[cfg(test)]
+#[cfg_attr(coverage_nightly, coverage(off))]
mod test {
use crate::{
bitcoin::secp256k1::Secp256k1,
}
#[cfg(test)]
+#[cfg_attr(coverage_nightly, coverage(off))]
mod test {
use crate::{bdk_electrum_client::TxUpdate, BdkElectrumClient};
use bdk_chain::bitcoin::{OutPoint, Transaction, TxIn};
//! [`example_electrum`]: https://github.com/bitcoindevkit/bdk/tree/master/examples/example_electrum
//! [`SyncResponse`]: bdk_core::spk_client::SyncResponse
//! [`FullScanResponse`]: bdk_core::spk_client::FullScanResponse
-
+#![cfg_attr(coverage_nightly, feature(coverage_attribute))]
#![warn(missing_docs)]
mod bdk_electrum_client;
}
#[cfg(test)]
+#[cfg_attr(coverage_nightly, coverage(off))]
mod test {
use std::{collections::BTreeSet, time::Duration};
}
#[cfg(test)]
+#[cfg_attr(coverage_nightly, coverage(off))]
mod test {
use crate::blocking_ext::{chain_update, fetch_latest_blocks};
use bdk_chain::bitcoin;
//! Just like how [`EsploraExt`] extends the functionality of an
//! [`esplora_client::BlockingClient`], [`EsploraAsyncExt`] is the async version which extends
//! [`esplora_client::AsyncClient`].
+#![cfg_attr(coverage_nightly, feature(coverage_attribute))]
use bdk_core::bitcoin::{Amount, OutPoint, TxOut, Txid};
use bdk_core::{BlockId, ConfirmationBlockTime, TxUpdate};
#![doc = include_str!("../README.md")]
+#![cfg_attr(coverage_nightly, feature(coverage_attribute))]
mod entry_iter;
mod store;
use std::io;
impl<C: fmt::Debug> std::error::Error for StoreErrorWithDump<C> {}
#[cfg(test)]
+#[cfg_attr(coverage_nightly, coverage(off))]
mod test {
use super::*;
serde = ["bdk_chain/serde"]
[package.metadata.docs.rs]
-no-default-features = true
\ No newline at end of file
+no-default-features = true
+#![cfg_attr(coverage_nightly, feature(coverage_attribute))]
+
pub mod utils;
use bdk_chain::{
}
#[cfg(test)]
+#[cfg_attr(coverage_nightly, coverage(off))]
mod test {
use crate::TestEnv;
use core::time::Duration;