name: Codecov on: pull_request: push: branches: - master jobs: test: name: Test runs-on: ubuntu-latest env: RUSTFLAGS: "-C instrument-coverage -C force-frame-pointers=yes -C no-stack-check" steps: - uses: actions/checkout@v4 with: submodules: true - name: Checkout submodules run: git submodule update --init --recursive - name: Install stable toolchain uses: dtolnay/rust-toolchain@stable - uses: Swatinem/rust-cache@v2 - name: Install llvm-tools and grcov run: | rustup component add llvm-tools-preview cargo install grcov - name: Install dependencies run: | sudo apt-get install -y cmake ninja-build binaryen; cargo install wasm-pack --version=0.13.1; - name: Clean previous builds run: cargo clean - name: Run tests with coverage run: | cargo test --verbose cargo test discv5_echo -- --ignored --verbose cargo test default_echo -- --ignored --verbose - name: Generate coverage report run: | mkdir -p /tmp/cov grcov ./target/debug/ \ --binary-path ./target/debug/ \ -s . \ -t lcov \ --branch \ --ignore-not-existing \ --ignore '../*' \ --ignore '/*' \ -o /tmp/cov/tests.lcov - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} directory: /tmp/cov/ name: waku-bindings-codecov fail_ci_if_error: true