diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 04bfb626..589c5277 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -45,18 +45,25 @@ jobs: - uses: supercharge/redis-github-action@1.1.0 with: redis-version: 5 + # Nightly is required for code coverage with doctests + # https://github.com/taiki-e/cargo-llvm-cov/issues/2 - uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: stable + toolchain: nightly override: true - uses: abelfodil/protoc-action@v1 with: protoc-version: '3.19.4' - - uses: actions-rs/cargo@v1 - with: - command: test - args: --all-features + - name: Install cargo-llvm-cov + uses: taiki-e/install-action@cargo-llvm-cov + - name: Test and Generate code coverage + run: cargo +nightly llvm-cov --all-features --workspace --lcov --doctests --output-path lcov.info + - name: Codecov + uses: codecov/codecov-action@v3 + with: + verbose: true + fail_ci_if_error: true fmt: name: Rustfmt diff --git a/README.md b/README.md index 1c17d76f..7a8c6972 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ [![Crates.io](https://img.shields.io/crates/v/limitador)](https://crates.io/crates/limitador) [![Docker Repository on Quay](https://quay.io/repository/kuadrant/limitador/status "Docker Repository on Quay")](https://quay.io/repository/kuadrant/limitador) +[![codecov](https://codecov.io/gh/Kuadrant/limitador/branch/master/graph/badge.svg?token=CE9LD3XCJT)](https://codecov.io/gh/Kuadrant/limitador) Limitador is a generic rate-limiter written in Rust. It can be used as a library, or as a service. The service exposes HTTP endpoints to apply and observe