@@ -22,19 +22,54 @@ jobs:
2222 - name : Run clippy (all targets and features)
2323 run : cargo clippy --all-targets --all-features -- -Dclippy::all -D warnings
2424
25- coverage :
25+ detect-changes :
2626 runs-on : ubuntu-latest
27+ outputs :
28+ mongodb : ${{ steps.filter.outputs.mongodb }}
29+ steps :
30+ - name : Checkout
31+ uses : actions/checkout@v4
32+ - name : Detect path changes
33+ uses : dorny/paths-filter@v3
34+ id : filter
35+ with :
36+ filters : |
37+ mongodb:
38+ - 'crates/hotfix-store-mongodb/**'
39+ - 'crates/hotfix-store/**'
40+
41+ coverage-core :
42+ runs-on : ubuntu-latest
43+ steps :
44+ - name : Checkout
45+ uses : actions/checkout@v4
46+ - name : Install cargo-llvm-cov
47+ uses : taiki-e/install-action@cargo-llvm-cov
48+ - name : Generate code coverage (excluding MongoDB)
49+ run : cargo llvm-cov --all-features --workspace --exclude hotfix-store-mongodb --lcov --output-path lcov.info
50+ - name : Upload coverage
51+ uses : codecov/codecov-action@v5
52+ with :
53+ fail_ci_if_error : true
54+ token : ${{ secrets.CODECOV_TOKEN }}
55+ flags : core
56+ files : lcov.info
57+
58+ coverage-mongodb :
59+ runs-on : ubuntu-latest
60+ needs : detect-changes
61+ if : needs.detect-changes.outputs.mongodb == 'true'
2762 steps :
2863 - name : Checkout
2964 uses : actions/checkout@v4
3065 - name : Install cargo-llvm-cov
3166 uses : taiki-e/install-action@cargo-llvm-cov
32- - name : Generate code coverage
33- run : cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
34- - name : Upload report
67+ - name : Generate MongoDB coverage
68+ run : cargo llvm-cov --all-features --package hotfix-store-mongodb --lcov --output-path lcov.info
69+ - name : Upload MongoDB coverage
3570 uses : codecov/codecov-action@v5
3671 with :
3772 fail_ci_if_error : true
3873 token : ${{ secrets.CODECOV_TOKEN }}
39- verbose : true
74+ flags : mongodb
4075 files : lcov.info
0 commit comments