From 7c70a3e712624473cf2cc1336cbadddad5148f9e Mon Sep 17 00:00:00 2001 From: Kevin Hahn Date: Wed, 7 Aug 2024 08:47:47 +0700 Subject: [PATCH] ensure build fails when dotnet test returns non-zero exit code --- .github/workflows/build.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 206443855..78e3d53c3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,11 +21,14 @@ jobs: - name: Build project run: dotnet build --configuration Release + # 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 - continue-on-error: true - run: dotnet test --filter "TestCategory != SkipOnTeamCity" --blame-hang-timeout 100s --logger:"trx;LogFilePrefix=results" --results-directory ./test-results + id: test + run: dotnet test --filter "TestCategory != SkipOnTeamCity" --blame-hang-timeout 5m --logger:"trx;LogFilePrefix=results" --results-directory ./test-results - name: Publish test results + if: ${{ !cancelled() && steps.test.outcome != 'skipped' }} uses: EnricoMi/publish-unit-test-result-action/windows@v2 with: check_name: LibPalaso Tests