Skip to content

Commit 22faf52

Browse files
committed
Merge #9: Add codecov ci workflow
0b85f92 Add badges in README (Steve Myers) d8083c7 Add codecov ci workflow (Steve Myers) Pull request description: Added code coverage and new badges in README. Top commit has no ACKs. Tree-SHA512: 45a731dc007db69807714441a62d1d3543399c51df4d71756d114ae25713b22d84d90294c9ef520f86b5eb825f2def1915c759056389d3c844b2b6c9825e2bc3
2 parents 519a4cf + 0b85f92 commit 22faf52

File tree

2 files changed

+72
-1
lines changed

2 files changed

+72
-1
lines changed

.github/workflows/code_coverage.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
on: [push, pull_request]
2+
3+
name: Code Coverage
4+
5+
jobs:
6+
Codecov:
7+
name: Code Coverage
8+
runs-on: ubuntu-latest
9+
env:
10+
RUSTFLAGS: "-Cinstrument-coverage"
11+
RUSTDOCFLAGS: "-Cinstrument-coverage"
12+
LLVM_PROFILE_FILE: "report-%p-%m.profraw"
13+
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v2
17+
- name: Install lcov tools
18+
run: sudo apt-get install lcov -y
19+
- name: Install rustup
20+
run: curl https://sh.rustup.rs -sSf | sh -s -- -y
21+
- name: Set default toolchain
22+
run: rustup default nightly
23+
- name: Set profile
24+
run: rustup set profile minimal
25+
- name: Add llvm tools
26+
run: rustup component add llvm-tools-preview
27+
- name: Update toolchain
28+
run: rustup update
29+
- name: Cache cargo
30+
uses: actions/cache@v3
31+
with:
32+
path: |
33+
~/.cargo/bin/
34+
~/.cargo/registry/index/
35+
~/.cargo/registry/cache/
36+
~/.cargo/git/db/
37+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
38+
- name: Install grcov
39+
run: if [[ ! -e ~/.cargo/bin/grcov ]]; then cargo install grcov; fi
40+
- name: Test
41+
# WARNING: this is not testing the following features: test-esplora, test-hardware-signer, async-interface
42+
# This is because some of our features are mutually exclusive, and generating various reports and
43+
# merging them doesn't seem to be working very well.
44+
# For more info, see:
45+
# - https://github.com/bitcoindevkit/bdk/issues/696
46+
# - https://github.com/bitcoindevkit/bdk/pull/748#issuecomment-1242721040
47+
run: cargo test
48+
- name: Run grcov
49+
run: mkdir coverage; grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore '/*' -o ./coverage/lcov.info
50+
- name: Generate HTML coverage report
51+
run: genhtml -o coverage-report.html ./coverage/lcov.info
52+
53+
- name: Coveralls upload
54+
uses: coverallsapp/github-action@master
55+
with:
56+
github-token: ${{ secrets.GITHUB_TOKEN }}
57+
- name: Upload artifact
58+
uses: actions/upload-artifact@v2
59+
with:
60+
name: coverage-report
61+
path: coverage-report.html

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
11
# rust-esplora-client
22

3-
Bitcoin Esplora API client library. Supports plaintext, TLS and Onion servers. Blocking or async
3+
Bitcoin Esplora API client library. Supports plaintext, TLS and Onion servers. Blocking or async.
4+
5+
<p>
6+
<a href="https://crates.io/crates/rust-esplora-client"><img alt="Crate Info" src="https://img.shields.io/crates/v/rust-esplora-client.svg"/></a>
7+
<a href="https://github.com/bitcoindevkit/rust-esplora-client/blob/master/LICENSE"><img alt="MIT Licensed" src="https://img.shields.io/badge/license-MIT-blue.svg"/></a>
8+
<a href="https://github.com/bitcoindevkit/rust-esplora-client/actions?query=workflow%3ACode%20Coverage"><img alt="CI Status" src="https://github.com/bitcoindevkit/rust-esplora-client/workflows/Code%20Coverage/badge.svg"></a>
9+
<a href='https://coveralls.io/github/bitcoindevkit/rust-esplora-client?branch=master'><img src='https://coveralls.io/repos/github/bitcoindevkit/rust-esplora-client/badge.svg?branch=master' alt='Coverage Status' /></a>
10+
<a href="https://docs.rs/rust-esplora-client"><img alt="API Docs" src="https://img.shields.io/badge/docs.rs-rust-esplora-client-green"/></a>
11+
<a href="https://blog.rust-lang.org/2021/11/01/Rust-1.56.1.html"><img alt="Rustc Version 1.56.1+" src="https://img.shields.io/badge/rustc-1.56.1%2B-lightgrey.svg"/></a>
12+
<a href="https://discord.gg/d7NkDKm"><img alt="Chat on Discord" src="https://img.shields.io/discord/753336465005608961?logo=discord"></a>
13+
</p>

0 commit comments

Comments
 (0)