@@ -3,35 +3,53 @@ on: [push]
3
3
name : Code Coverage
4
4
5
5
jobs :
6
-
7
6
Codecov :
8
7
name : Code Coverage
9
8
runs-on : ubuntu-latest
10
9
env :
11
- CARGO_INCREMENTAL : ' 0 '
12
- RUSTFLAGS : ' -Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off '
13
- RUSTDOCFLAGS : ' -Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off '
10
+ RUSTFLAGS : " -Cinstrument-coverage "
11
+ RUSTDOCFLAGS : " -Cinstrument-coverage "
12
+ LLVM_PROFILE_FILE : " report-%p-%m.profraw "
14
13
15
14
steps :
16
15
- name : Checkout
17
16
uses : actions/checkout@v2
17
+ - name : Install lcov tools
18
+ run : sudo apt-get install lcov -y
18
19
- name : Install rustup
19
20
run : curl https://sh.rustup.rs -sSf | sh -s -- -y
20
21
- name : Set default toolchain
21
22
run : rustup default nightly
22
23
- name : Set profile
23
24
run : rustup set profile minimal
25
+ - name : Add llvm tools
26
+ run : rustup component add llvm-tools-preview
24
27
- name : Update toolchain
25
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
26
40
- name : Test
27
- run : cargo test --features all-keys,compiler,esplora,ureq,compact_filters --no-default-features
28
-
29
- - id : coverage
30
- name : Generate coverage
31
- uses : actions-rs/[email protected]
41
+ run : cargo test --features default,minimal, all-keys,compact_filters,key-value-db, compiler,sqlite,sqlite-bundled,test-electrum,verify,test-rpc
42
+ - name : Run grcov
43
+ run : mkdir coverage; grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore '/*' -o ./coverage/lcov.info
44
+ - name : Generate HTML coverage report
45
+ run : genhtml -o coverage-report.html ./coverage/lcov.info
32
46
33
- - name : Upload coverage to Codecov
34
- uses : codecov/codecov-action@v2
47
+ - name : Coveralls upload
48
+ uses : coverallsapp/github-action@master
49
+ with :
50
+ github-token : ${{ secrets.GITHUB_TOKEN }}
51
+ - name : Upload artifact
52
+ uses : actions/upload-artifact@v2
35
53
with :
36
- file : ${{ steps. coverage.outputs. report }}
37
- directory : ./ coverage/reports/
54
+ name : coverage- report
55
+ path : coverage-report.html
0 commit comments