chore: add codecov for testing (#3)

Signed-off-by: Gaius <gaius.qi@gmail.com>
This commit is contained in:
Gaius 2023-03-24 18:05:05 +08:00 committed by GitHub
parent c1b714349f
commit 932d87f420
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 30 additions and 8 deletions

View File

@ -41,14 +41,17 @@ jobs:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: Install stable toolchain - name: Install cargo-llvm-cov
uses: actions-rs/toolchain@v1 uses: taiki-e/install-action@v2
with: with:
profile: minimal tool: cargo-llvm-cov
toolchain: stable
override: true
- name: Run cargo test - name: Run tests
uses: actions-rs/cargo@v1 run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with: with:
command: test token: ${{ secrets.CODECOV_TOKEN }}
files: lcov.info
fail_ci_if_error: true

1
.gitignore vendored
View File

@ -8,6 +8,7 @@ bin/
# Test binary, built with `go test -c` # Test binary, built with `go test -c`
*.test *.test
lcov.info
# Output of the go coverage tool, specifically when used with LiteIDE # Output of the go coverage tool, specifically when used with LiteIDE
*.out *.out

18
codecov.yml Normal file
View File

@ -0,0 +1,18 @@
coverage:
precision: 2
round: down
range: "80...100"
status:
project:
default:
enabled: no
patch:
default:
enabled: no
comment:
layout: "reach, diff, flags, files"
behavior: default
require_changes: false
branches:
- main