Skip to content

Commit

Permalink
Don't overwrite test results or coverage files across multiple runs o…
Browse files Browse the repository at this point in the history
…f target frameworks and architectures, preserve all files instead.
  • Loading branch information
Aldaviva committed Nov 7, 2023
1 parent f994517 commit 8b93b78
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions .github/workflows/dotnetpackage.yml
Expand Up @@ -26,32 +26,27 @@ jobs:
run: dotnet restore --verbosity normal

- name: Build
run: dotnet build --no-restore --configuration Release --verbosity normal
run: dotnet build ${{ env.ProjectName }} --no-restore --configuration Release --verbosity normal

- name: Test x64
run: |
dotnet test --arch x64 --verbosity normal --configuration Release --collect:"XPlat Code Coverage" --settings Test/Test.runsettings --logger "trx;LogFileName=TestResults-x64.xml" --logger "console;verbosity=detailed"
dotnet test --arch x64 --verbosity normal --configuration Release --collect:"XPlat Code Coverage" --settings Test/Test.runsettings --logger trx --logger "console;verbosity=detailed"
Out-File -InputObject "TEST_EXIT_CODE_X64=$LASTEXITCODE" -FilePath $env:GITHUB_ENV -Append -Encoding UTF8
Move-Item Test/TestResults/*/coverage.info Test/TestResults/coverage-x64.info -ErrorAction Continue
exit 0
- name: Test x86
run: |
dotnet test --arch x86 --verbosity normal --configuration Release --collect:"XPlat Code Coverage" --settings Test/Test.runsettings --logger "trx;LogFileName=TestResults-x86.xml" --logger "console;verbosity=detailed"
dotnet test --arch x86 --verbosity normal --configuration Release --collect:"XPlat Code Coverage" --settings Test/Test.runsettings --logger trx --logger "console;verbosity=detailed"
Out-File -InputObject "TEST_EXIT_CODE_X86=$LASTEXITCODE" -FilePath $env:GITHUB_ENV -Append -Encoding UTF8
Move-Item Test/TestResults/*/coverage.info Test/TestResults/coverage-x86.info -ErrorAction Continue
exit 0
- name: Upload test report
run: testspace Test/TestResults/TestResults*.xml
run: testspace Test/TestResults/*.trx

- name: Upload coverage
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
files: Test/TestResults/coverage-x86.info Test/TestResults/coverage-x64.info
format: lcov
allow-empty: true

- name: Stop if x64 tests failed
run: exit $env:TEST_EXIT_CODE_X64
Expand Down

0 comments on commit 8b93b78

Please sign in to comment.