diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4d5a5a14e..748be1754 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,17 +18,41 @@ jobs: with: fetch-depth: '0' - - name: Build project - run: dotnet build -bl:build.binlog --configuration Release + - name: Build project - Release + run: dotnet build -bl:build.rls.binlog --configuration Release + + - name: Build project - Debug + run: dotnet build -bl:build.dbg.binlog --configuration Debug # there are cases where this will fail and we want to know about it # so we don't use continue-on-error, but we still want to publish the results - - name: Test project - id: test - run: dotnet test -bl:test.binlog --filter "TestCategory != SkipOnTeamCity" --blame-hang-timeout 5m --logger:"trx;LogFilePrefix=results" --results-directory ./test-results + # Separate test steps for each framework to avoid file lock issues + - name: Test project (.NET Framework 4.6.2) + id: test_net462 + run: dotnet test --no-build -bl:test_net462.binlog --framework net462 --filter "TestCategory != SkipOnTeamCity" --blame-hang-timeout 5m --logger:"trx;LogFilePrefix=results_net462" --results-directory ./test-results/net462 + + - name: Kill lingering test processes + run: | + taskkill /F /IM testhost.exe /T || exit 0 + taskkill /F /IM dotnet.exe /T || exit 0 + continue-on-error: true + + - name: Test project (.NET Framework 4.8) + id: test_net48 + run: dotnet test --no-build -bl:test_net48.binlog --framework net48 --filter "TestCategory != SkipOnTeamCity" --blame-hang-timeout 5m --logger:"trx;LogFilePrefix=results_net48" --results-directory ./test-results/net48 + + - name: Kill lingering test processes + run: | + taskkill /F /IM testhost.exe /T || exit 0 + taskkill /F /IM dotnet.exe /T || exit 0 + continue-on-error: true + + - name: Test project (net8.0) + id: test_net8 + run: dotnet test --no-build -bl:test_net8.binlog --framework net8.0 --filter "TestCategory != SkipOnTeamCity" --blame-hang-timeout 5m --logger:"trx;LogFilePrefix=results_net8" --results-directory ./test-results/net8.0 - name: Publish test results - if: ${{ !cancelled() && steps.test.outcome != 'skipped' }} + if: ${{ !cancelled() && (steps.test_net462.outcome != 'skipped' || steps.test_net48.outcome != 'skipped' || steps.test_net8.outcome != 'skipped') }} uses: EnricoMi/publish-unit-test-result-action/windows@v2 with: check_name: LibPalaso Tests @@ -42,5 +66,8 @@ jobs: with: name: binary-logs path: | - build.binlog - test.binlog \ No newline at end of file + build.rls.binlog + build.dbg.binlog + test_net462.binlog + test_net48.binlog + test_net8.binlog \ No newline at end of file