Skip to content

Commit 8012172

Browse files
refactor codecov.yml
1 parent 1cca1b3 commit 8012172

File tree

1 file changed

+36
-27
lines changed

1 file changed

+36
-27
lines changed

.github/workflows/codecov.yml

Lines changed: 36 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,58 @@
1+
name: Codecov
2+
13
on:
24
pull_request:
35
push:
46
branches:
57
- master
68

7-
name: Codecov
8-
99
jobs:
1010
test:
1111
name: Test
12-
env:
13-
RUSTFLAGS: -C instrument-coverage -C force-frame-pointers=yes -C no-stack-check
1412
runs-on: ubuntu-latest
13+
env:
14+
RUSTFLAGS: "-C instrument-coverage -C force-frame-pointers=yes -C no-stack-check"
15+
1516
steps:
1617
- uses: actions/checkout@v4
1718
with:
1819
submodules: true
20+
1921
- name: Checkout submodules
2022
run: git submodule update --init --recursive
21-
- uses: actions-rs/toolchain@v1
22-
with:
23-
profile: minimal
24-
toolchain: stable
25-
override: true
26-
components: llvm-tools-preview
27-
- uses: actions-rs/cargo@v1
28-
continue-on-error: true
29-
- name: Install stable toolchain
30-
uses: dtolnay/rust-toolchain@stable
31-
- run: |
32-
echo "Installing grcov";
33-
cargo install grcov;
34-
echo "Running tests";
35-
cargo test --target x86_64-unknown-linux-gnu --verbose;
36-
echo "Running ignored tests for coverage";
37-
cargo test discv5_echo -- --ignored --target x86_64-unknown-linux-gnu --verbose;
38-
echo "Running default_echo ignored tests for coverage";
39-
cargo test default_echo -- --ignored --target x86_64-unknown-linux-gnu --verbose;
40-
mkdir /tmp/cov;
41-
echo "Generating coverage report";
42-
grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore '../*' --ignore "/*" -o /tmp/cov/tests.lcov;
23+
24+
- uses: dtolnay/rust-toolchain@stable
25+
26+
- name: Install llvm-tools and grcov
27+
run: |
28+
rustup component add llvm-tools-preview
29+
cargo install grcov
30+
31+
- name: Clean previous builds
32+
run: cargo clean
33+
34+
- name: Run tests with coverage
35+
run: |
36+
cargo test --verbose
37+
cargo test discv5_echo -- --ignored --verbose
38+
cargo test default_echo -- --ignored --verbose
39+
40+
- name: Generate coverage report
41+
run: |
42+
mkdir -p /tmp/cov
43+
grcov ./target/debug/ \
44+
--binary-path ./target/debug/ \
45+
-s . \
46+
-t lcov \
47+
--branch \
48+
--ignore-not-existing \
49+
--ignore '../*' \
50+
--ignore '/*' \
51+
-o /tmp/cov/tests.lcov
52+
4353
- uses: codecov/codecov-action@v3
4454
with:
4555
token: ${{ secrets.CODECOV_TOKEN }}
4656
directory: /tmp/cov/
4757
name: waku-bindings-codecov
4858
fail_ci_if_error: true
49-

0 commit comments

Comments
 (0)