chore: add codecov for testing (#3)
Signed-off-by: Gaius <gaius.qi@gmail.com>
This commit is contained in:
parent
c1b714349f
commit
932d87f420
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
Loading…
Reference in New Issue