test(coverage): migrate from tarpaulin to llvm-cov

This commit is contained in:
Ivan Gabriele
2024-03-05 02:30:09 +01:00
parent efcd93953a
commit 08b042506d
3 changed files with 7 additions and 3 deletions

View File

@@ -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 }}

View File

@@ -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

View File

@@ -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: