|
| 1 | +name: Codecov |
| 2 | + |
1 | 3 | on: |
2 | 4 | pull_request: |
3 | 5 | push: |
4 | 6 | branches: |
5 | 7 | - master |
6 | 8 |
|
7 | | -name: Codecov |
8 | | - |
9 | 9 | jobs: |
10 | 10 | test: |
11 | 11 | name: Test |
12 | | - env: |
13 | | - RUSTFLAGS: -C instrument-coverage -C force-frame-pointers=yes -C no-stack-check |
14 | 12 | runs-on: ubuntu-latest |
| 13 | + env: |
| 14 | + RUSTFLAGS: "-C instrument-coverage -C force-frame-pointers=yes -C no-stack-check" |
| 15 | + |
15 | 16 | steps: |
16 | 17 | - uses: actions/checkout@v4 |
17 | 18 | with: |
18 | 19 | submodules: true |
| 20 | + |
19 | 21 | - name: Checkout submodules |
20 | 22 | 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 | +
|
43 | 53 | - uses: codecov/codecov-action@v3 |
44 | 54 | with: |
45 | 55 | token: ${{ secrets.CODECOV_TOKEN }} |
46 | 56 | directory: /tmp/cov/ |
47 | 57 | name: waku-bindings-codecov |
48 | 58 | fail_ci_if_error: true |
49 | | - |
|
0 commit comments