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 }}