Skip to content

Commit

Permalink
Run coverage on test failures (#8269)
Browse files Browse the repository at this point in the history
  • Loading branch information
crusaderky authored Oct 16, 2023
1 parent eed2865 commit ad14903
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -235,13 +235,19 @@ jobs:
# as opposed to root. This is causing filename mismatches in Codecov.
# This step edits `coverage.xml` in-file by adding `distributed` to all filenames.
- name: Prepare coverage report
if: ${{ matrix.os != 'windows-latest' }}
if: >
always() &&
(steps.run_tests.outcome == 'success' || steps.run_tests.outcome == 'failure') &&
matrix.os != 'windows-latest'
shell: bash -l {0}
run: sed -i'' -e 's/filename="/filename="distributed\//g' coverage.xml

# Do not upload coverage reports for cron jobs
- name: Coverage
if: github.event_name != 'schedule'
if: >
always() &&
(steps.run_tests.outcome == 'success' || steps.run_tests.outcome == 'failure') &&
github.event_name != 'schedule'
uses: codecov/codecov-action@v3
with:
name: ${{ env.TEST_ID }}
Expand Down

0 comments on commit ad14903

Please sign in to comment.