From 91b998c0940d81a44355f38f81610d1c90effc0c Mon Sep 17 00:00:00 2001 From: Ishaan Goel Date: Tue, 1 Oct 2024 14:50:02 +0530 Subject: [PATCH 1/2] code coverage initiation --- .github/workflows/coverage.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/coverage.yml diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 0000000..05ce334 --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,27 @@ +name: Rust Coverage + +on: + push: + branches: [main] + pull_request: + +env: + CARGO_TERM_COLOR: always + +jobs: + test: + name: Test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable + with: + components: llvm-tools + - 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: + files: lcov.info + fail_ci_if_error: true From 2b2ce976801bf7ccea3da43716f1fd6f8798f08d Mon Sep 17 00:00:00 2001 From: Ishaan Goel Date: Tue, 1 Oct 2024 14:53:20 +0530 Subject: [PATCH 2/2] fix for token --- .github/workflows/coverage.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 05ce334..f64914c 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -1,4 +1,4 @@ -name: Rust Coverage +name: Code Coverage on: push: @@ -23,5 +23,6 @@ jobs: - name: Upload coverage to Codecov uses: codecov/codecov-action@v3 with: + token: ${{ secrets.CODECOV_TOKEN }} files: lcov.info fail_ci_if_error: true