Skip to content

Commit 733804c

Browse files
committed
Change configs for source-base code coverage
Also add cacheing to code coverage workflow
1 parent 03d3c78 commit 733804c

File tree

2 files changed

+27
-26
lines changed

2 files changed

+27
-26
lines changed

.github/workflows/code_coverage.yml

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@ on: [push]
33
name: Code Coverage
44

55
jobs:
6-
76
Codecov:
87
name: Code Coverage
98
runs-on: ubuntu-latest
109
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"
1413

1514
steps:
1615
- name: Checkout
@@ -21,17 +20,32 @@ jobs:
2120
run: rustup default nightly
2221
- name: Set profile
2322
run: rustup set profile minimal
23+
- name: Add llvm tools
24+
run: rustup component add llvm-tools-preview
2425
- name: Update toolchain
2526
run: rustup update
27+
- name: Cache cargo
28+
uses: actions/cache@v3
29+
with:
30+
path: |
31+
~/.cargo/bin/
32+
~/.cargo/registry/index/
33+
~/.cargo/registry/cache/
34+
~/.cargo/git/db/
35+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
36+
- name: Install grcov
37+
run: if [[ ! -e ~/.cargo/bin/grcov ]]; then cargo install grcov; fi
2638
- 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/grcov@v0.1.5
39+
run: cargo test --features default,minimal,all-keys,compact_filters,key-value-db,compiler,sqlite,sqlite-bundled,test-electrum,verify,test-rpc
40+
- name: Run grcov
41+
run: mkdir coverage; grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore '../**' -o ./coverage/lcov.info
3242

33-
- name: Upload coverage to Codecov
34-
uses: codecov/codecov-action@v2
43+
- name: Coveralls upload
44+
uses: coverallsapp/github-action@master
45+
with:
46+
github-token: ${{ secrets.GITHUB_TOKEN }}
47+
- name: Upload artifact
48+
uses: actions/upload-artifact@v2
3549
with:
36-
file: ${{ steps.coverage.outputs.report }}
37-
directory: ./coverage/reports/
50+
name: coverage-report
51+
path: ./coverage/lcov.info

codecov.yaml

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)