From 8b93b781f54b3840cc7ad92d6cb435e5f3a1d204 Mon Sep 17 00:00:00 2001 From: Ben Hutchison Date: Tue, 7 Nov 2023 00:46:20 -0800 Subject: [PATCH] Don't overwrite test results or coverage files across multiple runs of target frameworks and architectures, preserve all files instead. --- .github/workflows/dotnetpackage.yml | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/dotnetpackage.yml b/.github/workflows/dotnetpackage.yml index d219ad8..93e0e91 100644 --- a/.github/workflows/dotnetpackage.yml +++ b/.github/workflows/dotnetpackage.yml @@ -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