From 374a308d261e60bc1e40f874c52fea4282694b06 Mon Sep 17 00:00:00 2001 From: Jorge Leitao Date: Mon, 20 Nov 2023 06:42:28 +0100 Subject: [PATCH] Added coverage --- .github/workflows/test.yaml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index c3b2d73..573aceb 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -14,3 +14,21 @@ jobs: toolchain: stable - name: test run: cargo test + + coverage: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Install Rust + run: rustup toolchain install stable --component llvm-tools-preview + - name: Install cargo-llvm-cov + uses: taiki-e/install-action@cargo-llvm-cov + - uses: Swatinem/rust-cache@v1 + - name: Generate code coverage + run: cargo llvm-cov --lcov --output-path lcov.info + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos + files: lcov.info + fail_ci_if_error: true