test(coverage): migrate from tarpaulin to llvm-cov
This commit is contained in:
5
.github/workflows/test.yml
vendored
5
.github/workflows/test.yml
vendored
@@ -17,16 +17,19 @@ jobs:
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: 1.76.0
|
||||
- name: Install cargo-llvm-cov
|
||||
uses: taiki-e/install-action@cargo-llvm-cov
|
||||
- name: Run documentation tests
|
||||
run: make test-doc
|
||||
env:
|
||||
MISTRAL_API_KEY: ${{ secrets.MISTRAL_API_KEY }}
|
||||
- name: Run tests (with coverage)
|
||||
run: make test-cover
|
||||
run: cargo llvm-cov --lcov --output-path ./lcov.info
|
||||
env:
|
||||
MISTRAL_API_KEY: ${{ secrets.MISTRAL_API_KEY }}
|
||||
- name: Upload tests coverage
|
||||
uses: codecov/codecov-action@v4
|
||||
with:
|
||||
fail_ci_if_error: true
|
||||
files: ./lcov.info
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
|
||||
@@ -38,7 +38,8 @@ Then edit the `.env` file to set your `MISTRAL_API_KEY`.
|
||||
|
||||
### Optional requirements
|
||||
|
||||
- [cargo-watch](https://github.com/watchexec/cargo-watch#install) for `make test-*-watch`.
|
||||
- [cargo-llvm-cov](https://github.com/taiki-e/cargo-llvm-cov?tab=readme-ov-file#installation) for `make test-cover`
|
||||
- [cargo-watch](https://github.com/watchexec/cargo-watch#install) for `make test-watch`.
|
||||
|
||||
### Test
|
||||
|
||||
|
||||
2
Makefile
2
Makefile
@@ -38,7 +38,7 @@ release-major:
|
||||
test:
|
||||
@$(source_env_if_not_ci) && cargo test --no-fail-fast
|
||||
test-cover:
|
||||
@$(source_env_if_not_ci) && cargo tarpaulin --frozen --out Xml --skip-clean
|
||||
@$(source_env_if_not_ci) && cargo llvm-cov
|
||||
test-doc:
|
||||
@$(source_env_if_not_ci) && cargo test --doc --no-fail-fast
|
||||
test-watch:
|
||||
|
||||
Reference in New Issue
Block a user