Skip to content

Commit

Permalink
codecov test report upload
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamin-hodgson authored Jan 13, 2025
1 parent 281b841 commit 8271773
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ jobs:

- name: Compute version and write rsp file
run: |
shopt -s extglob
git fetch --tags --force # https://github.com/actions/checkout/issues/290#issuecomment-680260080
# 'git describe' outputs in a format like
Expand Down Expand Up @@ -64,13 +62,23 @@ jobs:

- id: test
name: Test
run: dotnet test --no-build --verbosity normal --collect:"XPlat Code Coverage" --logger trx
run: |
dotnet test --no-build --verbosity normal --collect:"XPlat Code Coverage" --logger trx --results-directory TestResults
dotnet tool install -g trx2junit
trx2junit TestResults/*.trx
# rename to .junit.xml so it can be picked up by codecov
ls TestResults/*.xml | xargs -I {} cp {} {}.junit.xml
# fails silently if CODECOV_TOKEN was not supplied
- uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}

- uses: codecov/test-results-action@v1
with:
files: TestResults/*.xml
token: ${{ secrets.CODECOV_TOKEN }}

- id: pack
name: Pack
run: dotnet pack --no-build
Expand Down Expand Up @@ -127,5 +135,6 @@ jobs:
with:
name: TestResults
path: |
**/TestResults/*.trx
**/TestResults/*/coverage.cobertura.xml
TestResults/*.trx
TestResults/*.xml
TestResults/*/coverage.cobertura.xml

0 comments on commit 8271773

Please sign in to comment.