From 2f10e17da1ae628bc1c4849e6418b2fac6f90b8e Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Sat, 2 Nov 2024 23:26:06 -0400 Subject: [PATCH] tests(ci): add coverage --- .github/workflows/ci.yml | 17 ++++++++++++++++- codecov.yml | 19 +++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 codecov.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bc958c2..d432517 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -61,9 +61,24 @@ jobs: cargo set-version ${{ needs.setup_release.outputs.release_version }} - name: Test + id: test uses: ./ci/github-actions/arch-run with: - command: cargo test + command: cargo install cargo-tarpaulin; cargo tarpaulin --engine llvm --out Xml + + - name: Upload coverage + # any except canceled or skipped + if: >- + always() && + (steps.test.outcome == 'success' || steps.test.outcome == 'failure') && + startsWith(github.repository, 'LizardByte/') + uses: codecov/codecov-action@v4 + with: + disable_search: true + fail_ci_if_error: true + files: ./target/debug/tarpaulin/report.xml + token: ${{ secrets.CODECOV_TOKEN }} + verbose: true - name: Clippy uses: ./ci/github-actions/arch-run diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000..e9c9c87 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,19 @@ +--- +codecov: + branch: master + +coverage: + status: + project: + default: + target: auto + threshold: 10% + +comment: + layout: "diff, flags, files" + behavior: default + require_changes: false # if true: only post the comment if coverage changes + +ignore: + - "tests" + - "third-party"