From b26eb9b22edf1cafc2f8f49c79d34d69f414a433 Mon Sep 17 00:00:00 2001 From: gusto Date: Mon, 19 Dec 2022 12:11:16 +0200 Subject: [PATCH] ci: codecov and badges (#30) * ci: codecov and badges * Add missing waku tests to codecov * Reverted binary copies; running ignored tests for coverage --- .github/workflows/codecov.yml | 43 +++++++++++++++++++++++++++++++++++ .github/workflows/release.yml | 4 ++-- README.md | 16 ++++++++++++- 3 files changed, 60 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/codecov.yml diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml new file mode 100644 index 0000000..55d034c --- /dev/null +++ b/.github/workflows/codecov.yml @@ -0,0 +1,43 @@ +on: + pull_request: + push: + branches: + - main + +name: Codecov + +jobs: + test: + name: Test + env: + RUSTFLAGS: -C instrument-coverage + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + submodules: true + - name: Checkout submodules + run: git submodule update --init --recursive + - uses: actions/setup-go@v3 # we need go to build go-waku + with: + go-version: '1.19' + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + components: llvm-tools-preview + - uses: actions-rs/cargo@v1 + continue-on-error: true + - run: | + cargo install grcov; + cargo test --all-features -- --ignored; + mkdir /tmp/cov; + grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore '../*' --ignore "/*" -o /tmp/cov/tests.lcov; + - uses: codecov/codecov-action@v3 + with: + directory: /tmp/cov/ + name: waku-bindings-codecov + fail_ci_if_error: true + + diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f51dcb3..3034495 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,7 +3,7 @@ on: tags: - v*.*.* -name: CI +name: Release jobs: release: @@ -15,4 +15,4 @@ jobs: override: true - uses: katyo/publish-crates@v1 with: - registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }} \ No newline at end of file + registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/README.md b/README.md index b816b31..fc62205 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,19 @@ # Waku Rust bindings +[![Crates.io][crates-badge]][crates-url] +[![Documentation][docs-badge]][docs-url] +[![Build Status][actions-badge]][actions-url] +[![Codecov Status][codecov-badge]][codecov-url] + +[crates-badge]: https://img.shields.io/crates/v/waku-bindings.svg +[crates-url]: https://crates.io/crates/waku-bindings +[docs-badge]: https://docs.rs/waku-bindings/badge.svg +[docs-url]: https://docs.rs/waku-bindings +[actions-badge]: https://github.com/waku-org/waku-rust-bindings/workflows/CI/badge.svg +[actions-url]: https://github.com/waku-org/waku-rust-bindings/actions/workflows/main.yml?query=workflow%3ACI+branch%3Amaster +[codecov-badge]: https://codecov.io/github/waku-org/waku-rust-bindings/branch/main/graph/badge.svg?token=H4CQWRUCUS +[codecov-url]: https://codecov.io/github/waku-org/waku-rust-bindings + Rust layer on top of [`go-waku`](https://github.com/status-im/go-waku) [c ffi bindings](https://github.com/status-im/go-waku/blob/v0.2.2/library/README.md). @@ -32,4 +46,4 @@ This makes it ideal for running a p2p protocol on mobile, or in other similarly -Read the [Waku docs](https://docs.wakuconnect.dev/) \ No newline at end of file +Read the [Waku docs](https://docs.wakuconnect.dev/)