From 8bbfbcc12b6111daf99cd9c4ffe04bbecf9be8f8 Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Mon, 29 Jul 2024 04:33:00 -0700 Subject: [PATCH] chore: setup codecov (#20) --- .github/workflows/ci.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5b98f4b..cf87add 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,3 +26,18 @@ jobs: run: cargo test --all-targets --all-features - name: Build run: cargo build --all-targets --all-features + - name: Install cargo-llvm-cov + uses: taiki-e/install-action@cargo-llvm-cov + if: ${{ matrix.os == 'ubuntu-latest' }} + - name: Generate code coverage + shell: bash + if: ${{ matrix.os == 'ubuntu-latest' }} + run: | + cargo llvm-cov --ignore-filename-regex cli.rs --lcov --output-path lcov.info + - name: Upload coverage to Codecov + if: ${{ matrix.os == 'ubuntu-latest' }} + uses: codecov/codecov-action@v4 + with: + files: lcov.info + fail_ci_if_error: false + token: ${{ secrets.CODECOV_TOKEN }}