refactor codecov.yml

This commit is contained in:
Ivan Folgueira Bande 2025-10-08 14:27:56 +02:00
parent 1cca1b3490
commit 8012172a1e
No known key found for this signature in database
GPG Key ID: 3C117481F89E24A7

View File

@ -1,49 +1,58 @@
name: Codecov
on: on:
pull_request: pull_request:
push: push:
branches: branches:
- master - master
name: Codecov
jobs: jobs:
test: test:
name: Test name: Test
env:
RUSTFLAGS: -C instrument-coverage -C force-frame-pointers=yes -C no-stack-check
runs-on: ubuntu-latest runs-on: ubuntu-latest
env:
RUSTFLAGS: "-C instrument-coverage -C force-frame-pointers=yes -C no-stack-check"
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
submodules: true submodules: true
- name: Checkout submodules - name: Checkout submodules
run: git submodule update --init --recursive run: git submodule update --init --recursive
- uses: actions-rs/toolchain@v1
with: - uses: dtolnay/rust-toolchain@stable
profile: minimal
toolchain: stable - name: Install llvm-tools and grcov
override: true run: |
components: llvm-tools-preview rustup component add llvm-tools-preview
- uses: actions-rs/cargo@v1 cargo install grcov
continue-on-error: true
- name: Install stable toolchain - name: Clean previous builds
uses: dtolnay/rust-toolchain@stable run: cargo clean
- run: |
echo "Installing grcov"; - name: Run tests with coverage
cargo install grcov; run: |
echo "Running tests"; cargo test --verbose
cargo test --target x86_64-unknown-linux-gnu --verbose; cargo test discv5_echo -- --ignored --verbose
echo "Running ignored tests for coverage"; cargo test default_echo -- --ignored --verbose
cargo test discv5_echo -- --ignored --target x86_64-unknown-linux-gnu --verbose;
echo "Running default_echo ignored tests for coverage"; - name: Generate coverage report
cargo test default_echo -- --ignored --target x86_64-unknown-linux-gnu --verbose; run: |
mkdir /tmp/cov; mkdir -p /tmp/cov
echo "Generating coverage report"; grcov ./target/debug/ \
grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore '../*' --ignore "/*" -o /tmp/cov/tests.lcov; --binary-path ./target/debug/ \
-s . \
-t lcov \
--branch \
--ignore-not-existing \
--ignore '../*' \
--ignore '/*' \
-o /tmp/cov/tests.lcov
- uses: codecov/codecov-action@v3 - uses: codecov/codecov-action@v3
with: with:
token: ${{ secrets.CODECOV_TOKEN }} token: ${{ secrets.CODECOV_TOKEN }}
directory: /tmp/cov/ directory: /tmp/cov/
name: waku-bindings-codecov name: waku-bindings-codecov
fail_ci_if_error: true fail_ci_if_error: true