Skip to content

Commit

Permalink
Only run coverage if tests succeed
Browse files Browse the repository at this point in the history
So that we get test errors on the right place
  • Loading branch information
aborgna-q committed Oct 31, 2023
1 parent 084554c commit 240eb0b
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 38 deletions.
27 changes: 26 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,29 @@ jobs:
- name: Tests with no features
run: cargo test --verbose --no-default-features
- name: Tests with all features
run: cargo test --verbose --all-features
run: cargo test --verbose --all-features

coverage:
if: github.event_name != 'merge_group'
needs: [tests, check]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: mozilla-actions/[email protected]
- uses: dtolnay/rust-toolchain@nightly
with:
components: llvm-tools-preview
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Run tests with coverage instrumentation
run: |
cargo llvm-cov clean --workspace
cargo llvm-cov --doctests
- name: Generate coverage report
run: cargo llvm-cov report --codecov --output-path coverage.json
- name: Upload coverage to codecov.io
uses: codecov/codecov-action@v3
with:
files: coverage.json
name: ubuntu
token: ${{ secrets.CODECOV_TOKEN }}
37 changes: 0 additions & 37 deletions .github/workflows/coverage.yml

This file was deleted.

0 comments on commit 240eb0b

Please sign in to comment.