Skip to content

Commit 70f1c9f

Browse files
committed
Upload code coverage
1 parent fb7960e commit 70f1c9f

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

.github/workflows/build.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jobs:
2222
build-net-tokio-tokio: true
2323
- toolchain: 1.39.0
2424
build-net-tokio: true
25+
coverage: true
2526
runs-on: ubuntu-latest
2627
steps:
2728
- name: Checkout source code
@@ -44,6 +45,24 @@ jobs:
4445
- name: Test on Rust ${{ matrix.toolchain }}
4546
if: ${{ matrix.build-net-tokio }} != true
4647
run: RUSTFLAGS="-C link-dead-code" cargo test --verbose -p lightning
48+
- name: Install kcov
49+
if: ${{ matrix.coverage }}
50+
run: |
51+
wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz
52+
tar xzf master.tar.gz
53+
cd kcov-master &&mkdir build && cd build
54+
cmake .. && make
55+
make install DESTDIR=../../kcov-build
56+
cd ../.. && rm -rf kcov-master
57+
- name: Upload coverage
58+
if: ${{ matrix.coverage }}
59+
run: |
60+
for file in target/debug/lightning-*; do
61+
[ -x "${file}" ] || continue;
62+
mkdir -p "target/cov/$(basename $file)";
63+
./kcov-build/usr/local/bin/kcov --exclude-pattern=/.cargo,/usr/lib --verify "target/cov/$(basename $file)" "$file";
64+
done
65+
bash <(curl -s https://codecov.io/bash)
4766
4867
fuzz:
4968
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)