From 2b5f6576300802154f3d1f070aa02897a2a891fb Mon Sep 17 00:00:00 2001 From: Kasun Ranasinghe Date: Fri, 29 Aug 2025 08:57:51 +0530 Subject: [PATCH 1/2] Added CodeCov for coverage --- .github/workflows/ci.yml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6c5d90b..d79ef31 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,7 +46,23 @@ jobs: run: cargo build --verbose # Step 5: Run unit tests - - name: Run tests - run: cargo test --verbose + # - name: Run tests + # run: cargo test --verbose + - name: Install llvm-tools and cargo-llvm-cov + run: | + rustup component add llvm-tools-preview + cargo install cargo-llvm-cov + + - name: Run coverage + run: | + cargo llvm-cov --lcov --output-path lcov.info + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v5 + with: + files: lcov.info + flags: unittests + fail_ci_if_error: true + token: ${{ secrets.CODECOV_TOKEN }} From 5e95b28a640bcba2fc48d55d654a03ff5c956b98 Mon Sep 17 00:00:00 2001 From: Kasun Ranasinghe Date: Fri, 29 Aug 2025 09:06:10 +0530 Subject: [PATCH 2/2] Added Codecove to publish --- .github/workflows/publish.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index ea26372..65992a0 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -49,8 +49,22 @@ jobs: run: cargo build --verbose # Step 5: Run unit tests - - name: Run tests - run: cargo test --verbose + - name: Install llvm-tools and cargo-llvm-cov + run: | + rustup component add llvm-tools-preview + cargo install cargo-llvm-cov + + - name: Run coverage + run: | + cargo llvm-cov --lcov --output-path lcov.info + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v5 + with: + files: lcov.info + flags: unittests + fail_ci_if_error: true + token: ${{ secrets.CODECOV_TOKEN }} # Check that there are no SemVer violations before releasing. # https://github.com/obi1kenobi/cargo-semver-checks