diff --git a/.github/workflows/_rust.yml b/.github/workflows/_rust.yml index 8e9783b..da80225 100644 --- a/.github/workflows/_rust.yml +++ b/.github/workflows/_rust.yml @@ -48,11 +48,17 @@ jobs: with: toolchain: stable - uses: Swatinem/rust-cache@v2 - - - name: Build Everything - run: cargo build --all-targets - - name: Run tests - run: cargo test --all-targets --verbose + - name: Install cargo-llvm-cov + uses: taiki-e/install-action@cargo-llvm-cov + - name: Run tests and generate code coverage + run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info + - name: Upload coverage to Codecov + uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5 + with: + files: lcov.info + fail_ci_if_error: true + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} # Ensure that no files (most likely the Cargo.lock file) have changed - name: Unstaged Changes run: git diff --exit-code