From ec2d3289f0445be4eae8e3b57941b6d516a3abd9 Mon Sep 17 00:00:00 2001 From: agokarn Date: Sun, 24 Nov 2024 04:18:15 +0000 Subject: [PATCH] Add code coverage. Remove deprecated version of upload-artifact Run code coverage only once for the stable version of rust modified: .github/workflows/check.yml --- .github/workflows/check.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index b06c536..9e01641 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -83,3 +83,20 @@ jobs: if: ${{ success() || failure() }} run: | cargo clippy --tests --no-default-features --features ${{ matrix.hpke }},client,server + + - name: Install cargo-llvm-cov + if: matrix.rust == 'stable' + run: | + cargo install cargo-llvm-cov + + - name: Generate coverage report + if: matrix.rust == 'stable' + run: | + cargo llvm-cov --features ${{ matrix.hpke }},client,server --cobertura --output-path target/cobertura.xml -- --test --test-threads=1 + + - name: Upload coverage artifact + if: matrix.rust == 'stable' + uses: actions/upload-artifact@v4 + with: + name: coverage-report + path: target/cobertura.xml