Skip to content

Commit

Permalink
Slapping dotnet node reuse disable on everything
Browse files Browse the repository at this point in the history
  • Loading branch information
Piedone committed Nov 16, 2022
1 parent 84b9436 commit 60c4911
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ Write-Output ".NET version number: $Version"
# - -p:Retries and -p:RetryDelayMilliseconds are to retry builds if it fails the first time due to random locks.
# - --warnAsMessage:MSB3026 is also to prevent random locks along the lines of "warning MSB3026: Could not copy dlls
# errors." from breaking the build (since we treat warnings as errors).
# - /nodeReuse:false, -p:UseRazorBuildServer=false, -p:UseSharedCompilation=false are to prevent dotnest test hangs,
# see: https://github.com/Lombiq/UI-Testing-Toolbox/issues/228.

$buildSwitches = ConvertTo-Array @"
--configuration:Release
Expand All @@ -29,6 +31,9 @@ $buildSwitches = ConvertTo-Array @"
-p:RunAnalyzersDuringBuild=$EnableCodeAnalysis
-p:Retries=4
-p:RetryDelayMilliseconds=1000
/nodeReuse:false
-p:UseRazorBuildServer=false
-p:UseSharedCompilation=false
-p:Version=$Version
$Switches
"@
Expand All @@ -51,7 +56,7 @@ if (Test-Path src/Utilities/Lombiq.Gulp.Extensions/Lombiq.Gulp.Extensions.csproj
# This prepares the solution or project with the Lombiq.Analyzers files. The output and exit code are discarded because
# they will be in error if there is a project without the LombiqNetAnalyzers target. Then there is nothing to do, and
# the target will still run on the projects that have it.
dotnet msbuild '-target:Restore;LombiqNetAnalyzers' $SolutionOrProject | Out-Null || bash -c 'true'
dotnet msbuild '-target:Restore;LombiqNetAnalyzers' $SolutionOrProject '/nodeReuse:false' | Out-Null || bash -c 'true'

Write-Output "Building solution or project with ``dotnet build $SolutionOrProject $($buildSwitches -join " ")``."

Expand Down
3 changes: 3 additions & 0 deletions .github/actions/build-dotnet/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ runs:
- name: Build and Static Code Analysis
shell: pwsh
working-directory: ${{ inputs.directory }}
env:
# See Build-DotNetSolutionOrProject.ps1 for the reasons to disable node reuse.
MSBUILDDISABLENODEREUSE: "1"
run: |
$buildSwitches = @'
${{ inputs.dotnet-build-switches }}
Expand Down
3 changes: 3 additions & 0 deletions .github/actions/test-dotnet/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ runs:
- name: Run Tests
shell: pwsh
working-directory: ${{ inputs.build-directory }}
env:
# See Build-DotNetSolutionOrProject.ps1 for the reasons to disable node reuse.
MSBUILDDISABLENODEREUSE: "1"
run: Invoke-SolutionTests -Verbosity ${{ inputs.test-verbosity }} -Filter "${{ inputs.test-filter }}"

# Note that uploading the failure dumps would fail under Windows if the path were too long, regardless of
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-and-test-orchard-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
with:
directory: ${{ inputs.build-directory }}
verbosity: ${{ inputs.build-verbosity }}
Expand All @@ -153,7 +153,7 @@ jobs:
location: ${{ inputs.build-directory}}

- name: Tests
uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@dev
uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-464
with:
build-directory: ${{ inputs.build-directory }}
test-verbosity: ${{ inputs.build-verbosity }}
Expand Down

0 comments on commit 60c4911

Please sign in to comment.