@@ -105,13 +105,38 @@ jobs:
105105
106106 - name : Install `rust` toolchain
107107 run : |
108- rustup toolchain install nightly --no-self-update -c rustfmt --profile minimal
108+ rustup toolchain install nightly --no-self-update -c rustfmt --profile minimal --component llvm-tools-preview
109109 rustup default nightly
110110
111- - name : Install cargo-llvm-cov
112- uses : taiki-e/install-action@cargo-llvm-cov
113- - name : Generate code coverage
114- run : cargo llvm-cov --all-features --lcov --branch --output-path lcov.info
111+ #- name: Build
112+ #env:
113+ #RUSTFLAGS: -Cinstrument-coverage
114+ #run: cargo build
115+
116+ - name : Test
117+ env :
118+ LLVM_PROFILE_FILE : $RUNNER_TEMP/findutils-%p-%m.profraw
119+ RUSTFLAGS : -Cinstrument-coverage
120+ run : cargo test --workspace --no-fail-fast ${{ matrix.cargo_flags }}
121+
122+ - name : Generate coverage data
123+ id : grcov
124+ run : |
125+ grcov target/debug/ \
126+ --branch \
127+ --llvm \
128+ --source-dir . \
129+ --output-path lcov.info \
130+ --ignore-not-existing \
131+ --binary-path target/debug/ \
132+ --excl-line "#\\[derive\\(" \
133+ --excl-br-line "#\\[derive\\(" \
134+ --excl-start "#\\[cfg\\(test\\)\\]" \
135+ --excl-br-start "#\\[cfg\\(test\\)\\]" \
136+ --commit-sha ${{ github.sha }} \
137+ --service-job-id ${{ github.job }} \
138+ --service-name "GitHub Actions" \
139+ --service-number ${{ github.run_id }}
115140
116141 - name : Upload coverage as artifact
117142 uses : actions/upload-artifact@v4
0 commit comments