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
|
uses: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
toolchain: 1.76.0
|
toolchain: 1.76.0
|
||||||
|
- name: Install cargo-llvm-cov
|
||||||
|
uses: taiki-e/install-action@cargo-llvm-cov
|
||||||
- name: Run documentation tests
|
- name: Run documentation tests
|
||||||
run: make test-doc
|
run: make test-doc
|
||||||
env:
|
env:
|
||||||
MISTRAL_API_KEY: ${{ secrets.MISTRAL_API_KEY }}
|
MISTRAL_API_KEY: ${{ secrets.MISTRAL_API_KEY }}
|
||||||
- name: Run tests (with coverage)
|
- name: Run tests (with coverage)
|
||||||
run: make test-cover
|
run: cargo llvm-cov --lcov --output-path ./lcov.info
|
||||||
env:
|
env:
|
||||||
MISTRAL_API_KEY: ${{ secrets.MISTRAL_API_KEY }}
|
MISTRAL_API_KEY: ${{ secrets.MISTRAL_API_KEY }}
|
||||||
- name: Upload tests coverage
|
- name: Upload tests coverage
|
||||||
uses: codecov/codecov-action@v4
|
uses: codecov/codecov-action@v4
|
||||||
with:
|
with:
|
||||||
fail_ci_if_error: true
|
fail_ci_if_error: true
|
||||||
|
files: ./lcov.info
|
||||||
token: ${{ secrets.CODECOV_TOKEN }}
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
|
|||||||
@@ -38,7 +38,8 @@ Then edit the `.env` file to set your `MISTRAL_API_KEY`.
|
|||||||
|
|
||||||
### Optional requirements
|
### 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
|
### Test
|
||||||
|
|
||||||
|
|||||||
2
Makefile
2
Makefile
@@ -38,7 +38,7 @@ release-major:
|
|||||||
test:
|
test:
|
||||||
@$(source_env_if_not_ci) && cargo test --no-fail-fast
|
@$(source_env_if_not_ci) && cargo test --no-fail-fast
|
||||||
test-cover:
|
test-cover:
|
||||||
@$(source_env_if_not_ci) && cargo tarpaulin --frozen --out Xml --skip-clean
|
@$(source_env_if_not_ci) && cargo llvm-cov
|
||||||
test-doc:
|
test-doc:
|
||||||
@$(source_env_if_not_ci) && cargo test --doc --no-fail-fast
|
@$(source_env_if_not_ci) && cargo test --doc --no-fail-fast
|
||||||
test-watch:
|
test-watch:
|
||||||
|
|||||||
Reference in New Issue
Block a user