From d7b75cba279dcacdebea372b3255b29656f63eab Mon Sep 17 00:00:00 2001 From: josh rotenberg Date: Fri, 29 Mar 2024 15:30:58 -0700 Subject: [PATCH] add llvm-cov to template ci move this into the raw block --- template/.github/workflows/ci.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/template/.github/workflows/ci.yml b/template/.github/workflows/ci.yml index 5aeb63f..6669960 100644 --- a/template/.github/workflows/ci.yml +++ b/template/.github/workflows/ci.yml @@ -61,4 +61,25 @@ jobs: env: RUSTDOCFLAGS: -D warnings run: cargo doc --no-deps --document-private-items --all-features --workspace --examples + + coverage: + name: Coverage + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@v2 + - name: Install cargo-llvm-cov + uses: taiki-e/install-action@cargo-llvm-cov + - name: Generate code coverage + run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: lcov.info + fail_ci_if_error: true {% endraw %} +