Skip to content

Commit

Permalink
tests(ci): add coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
ReenigneArcher committed Nov 3, 2024
1 parent 79bfca9 commit 4a3b8bd
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
17 changes: 16 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 --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
Expand Down
19 changes: 19 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit 4a3b8bd

Please sign in to comment.