From 6df3c1e3eba0dd266d0c7879bb434bd7d0512e65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Sun, 20 Nov 2022 23:07:42 +0100 Subject: [PATCH 1/3] Failing build is dotnet build fails --- .../actions/build-dotnet/Build-DotNetSolutionOrProject.ps1 | 5 +++++ .github/workflows/build-and-test-orchard-core.yml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/actions/build-dotnet/Build-DotNetSolutionOrProject.ps1 b/.github/actions/build-dotnet/Build-DotNetSolutionOrProject.ps1 index 8e9e91b1f..0b6443d84 100644 --- a/.github/actions/build-dotnet/Build-DotNetSolutionOrProject.ps1 +++ b/.github/actions/build-dotnet/Build-DotNetSolutionOrProject.ps1 @@ -69,6 +69,11 @@ dotnet build $SolutionOrProject @buildSwitches 2>&1 | ForEach-Object { if ($noErrors) { Write-Output "::error file=$file,line=$line,col=$column::$message" } } +if ($noErrors -and !$?) +{ + exit 100 +} + # With node reuse, dotnet build spawns processes that while speed up build, they can cause dotnet test and other dotnet # tools to randomly hang. So, here we shut down those processes for later actions. # For details see: https://github.com/Lombiq/UI-Testing-Toolbox/issues/228. diff --git a/.github/workflows/build-and-test-orchard-core.yml b/.github/workflows/build-and-test-orchard-core.yml index 6d74e249f..78b5538fc 100644 --- a/.github/workflows/build-and-test-orchard-core.yml +++ b/.github/workflows/build-and-test-orchard-core.yml @@ -133,7 +133,7 @@ jobs: uses: Lombiq/GitHub-Actions/.github/actions/enable-corepack@dev - name: Build and Static Code Analysis - uses: Lombiq/GitHub-Actions/.github/actions/build-dotnet@dev + uses: Lombiq/GitHub-Actions/.github/actions/build-dotnet@issue/OSOE-464-build-errors-not-failing with: directory: ${{ inputs.build-directory }} verbosity: ${{ inputs.build-verbosity }} From 1ef68b65427c9c0d47cc0c173334510810252f4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Sun, 20 Nov 2022 23:16:28 +0100 Subject: [PATCH 2/3] Not going overboard with exit codes --- .github/actions/build-dotnet/Build-DotNetSolutionOrProject.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/build-dotnet/Build-DotNetSolutionOrProject.ps1 b/.github/actions/build-dotnet/Build-DotNetSolutionOrProject.ps1 index 0b6443d84..f36566dda 100644 --- a/.github/actions/build-dotnet/Build-DotNetSolutionOrProject.ps1 +++ b/.github/actions/build-dotnet/Build-DotNetSolutionOrProject.ps1 @@ -71,7 +71,7 @@ dotnet build $SolutionOrProject @buildSwitches 2>&1 | ForEach-Object { if ($noErrors -and !$?) { - exit 100 + exit 1 } # With node reuse, dotnet build spawns processes that while speed up build, they can cause dotnet test and other dotnet From 937fd22011eb8a30c154eeee21ee5b10b711c550 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Sun, 20 Nov 2022 23:41:48 +0100 Subject: [PATCH 3/3] Removing issue branch reference --- .github/workflows/build-and-test-orchard-core.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-test-orchard-core.yml b/.github/workflows/build-and-test-orchard-core.yml index 78b5538fc..6d74e249f 100644 --- a/.github/workflows/build-and-test-orchard-core.yml +++ b/.github/workflows/build-and-test-orchard-core.yml @@ -133,7 +133,7 @@ jobs: uses: Lombiq/GitHub-Actions/.github/actions/enable-corepack@dev - name: Build and Static Code Analysis - uses: Lombiq/GitHub-Actions/.github/actions/build-dotnet@issue/OSOE-464-build-errors-not-failing + uses: Lombiq/GitHub-Actions/.github/actions/build-dotnet@dev with: directory: ${{ inputs.build-directory }} verbosity: ${{ inputs.build-verbosity }}