From 715c938e4023301986a623f1f60d0b10282673eb Mon Sep 17 00:00:00 2001 From: Vadim Rutkovsky Date: Tue, 24 Dec 2024 09:05:38 +0100 Subject: [PATCH] github: run tests when collecting coverage --- .github/workflows/rust.yml | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 369d805..147de62 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -74,22 +74,25 @@ jobs: tool: cargo-tarpaulin env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Generate test result and coverage report - run: | - cargo install cargo2junit; - cargo build --verbose; - cargo test $CARGO_OPTIONS -- -Z unstable-options --format json | cargo2junit > results.xml; + - name: Run cargo-tarpaulin + uses: clechasseur/rs-cargo@v2 + with: + command: tarpaulin + args: -- -Z unstable-options --format=json > report.json + - name: Install cargo2junit + uses: taiki-e/install-action@v2 + with: + tool: cargo2junit + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Build junit xml + run: cargo2junit > results.xml - name: Upload test results uses: EnricoMi/publish-unit-test-result-action@v2 with: check_name: Test Results github_token: ${{ secrets.GITHUB_TOKEN }} files: results.xml - - name: Run cargo-tarpaulin - uses: clechasseur/rs-cargo@v2 - with: - command: tarpaulin - args: --skip-clean - name: Upload to CodeCov uses: codecov/codecov-action@v5 with: