From 63b3cd77405aef7afb3654438dd86af9d1d9b0a6 Mon Sep 17 00:00:00 2001 From: Fryderyk Huang Date: Sat, 20 Jan 2024 03:09:43 +0800 Subject: [PATCH] Remove x86 test before GHA supports x86 SDK installation. dotnet run --project on GHA has to specify .csproj path. --- scripts/Build.ps1 | 6 ++++-- scripts/Clean.ps1 | 4 ++-- scripts/CleanAll.ps1 | 5 ++--- scripts/GenBenchmarkPage.ps1 | 3 ++- scripts/Pack.ps1 | 1 + scripts/Restore.ps1 | 5 +++-- scripts/RunBenchmarks.ps1 | 3 ++- scripts/Test.ps1 | 20 ++++++++++++-------- 8 files changed, 28 insertions(+), 19 deletions(-) diff --git a/scripts/Build.ps1 b/scripts/Build.ps1 index f811170..e1cbcf5 100644 --- a/scripts/Build.ps1 +++ b/scripts/Build.ps1 @@ -1,16 +1,18 @@ . $PSScriptRoot\Variables.ps1 -pushd $SolutionDir +Push-Location $SolutionDir $Env:Platform = '' foreach ($project in $Projects) { dotnet build --no-restore -c Release .\$project\$project.csproj + if (!$?) { throw } } $Env:Platform = 'x64' foreach ($project in $Projects) { dotnet build --no-restore -c Release .\$project\$project.csproj + if (!$?) { throw } } -popd +Pop-Location diff --git a/scripts/Clean.ps1 b/scripts/Clean.ps1 index 0727cad..1002e0b 100644 --- a/scripts/Clean.ps1 +++ b/scripts/Clean.ps1 @@ -1,5 +1,5 @@ . $PSScriptRoot\Variables.ps1 -pushd $SolutionDir +Push-Location $SolutionDir $Env:Platform = '' foreach ($project in $Projects) @@ -15,4 +15,4 @@ foreach ($project in $Projects) dotnet clean -c Debug .\$project\$project.csproj } -popd +Pop-Location diff --git a/scripts/CleanAll.ps1 b/scripts/CleanAll.ps1 index e9cb56e..7abba4c 100644 --- a/scripts/CleanAll.ps1 +++ b/scripts/CleanAll.ps1 @@ -1,5 +1,5 @@ . $PSScriptRoot\Variables.ps1 -pushd $SolutionDir +Push-Location $SolutionDir $Env:Platform = '' dotnet clean -c Release @@ -9,5 +9,4 @@ $Env:Platform = 'x64' dotnet clean -c Release dotnet clean -c Debug - -popd +Pop-Location diff --git a/scripts/GenBenchmarkPage.ps1 b/scripts/GenBenchmarkPage.ps1 index 9366b65..4f26824 100644 --- a/scripts/GenBenchmarkPage.ps1 +++ b/scripts/GenBenchmarkPage.ps1 @@ -2,5 +2,6 @@ Push-Location $SolutionDir if (!(Test-Path -PathType Container $BenchmarkResultPageDir)) { New-Item -ItemType Directory -Path $BenchmarkResultPageDir } Copy-Item $BenchmarkArtifactsDir\results\*.html $BenchmarkResultPageDir -dotnet run --project .\BenchmarkResultPageGenerator $BenchmarkArtifactsDir\results '' $BenchmarkResultPageDir\index.html +dotnet run --project .\BenchmarkResultPageGenerator\BenchmarkResultPageGenerator.csproj $BenchmarkArtifactsDir\results '' $BenchmarkResultPageDir\index.html +if (!$?) { throw } Pop-Location diff --git a/scripts/Pack.ps1 b/scripts/Pack.ps1 index 80970c5..4a42740 100644 --- a/scripts/Pack.ps1 +++ b/scripts/Pack.ps1 @@ -6,6 +6,7 @@ if (!(Test-Path -PathType Container $ArtifactsDir)) { New-Item -ItemType Directo $Env:Platform = '' foreach ($project in $Projects) { dotnet pack --no-build -c Release -o $ArtifactsDir "-p:Version=$Env:GitVersion_NuGetVersionV2" .\$project\$project.csproj + if (!$?) { throw } } Pop-Location diff --git a/scripts/Restore.ps1 b/scripts/Restore.ps1 index 9abb500..dac634c 100644 --- a/scripts/Restore.ps1 +++ b/scripts/Restore.ps1 @@ -1,8 +1,9 @@ . $PSScriptRoot\Variables.ps1 -pushd $SolutionDir +Push-Location $SolutionDir foreach ($project in $Projects) { dotnet restore .\$project\$project.csproj + if (!$?) { throw } } -popd +Pop-Location diff --git a/scripts/RunBenchmarks.ps1 b/scripts/RunBenchmarks.ps1 index 0195a30..ada0020 100644 --- a/scripts/RunBenchmarks.ps1 +++ b/scripts/RunBenchmarks.ps1 @@ -2,5 +2,6 @@ Push-Location $SolutionDir if (!(Test-Path -PathType Container $BenchmarkArtifactsDir)) { New-Item -ItemType Directory -Path $BenchmarkArtifactsDir } $Env:BenchmarkDotNet_ArtifactsPath = $BenchmarkArtifactsDir; -$Env:Platform = 'x64'; dotnet run -c Release --project .\NullGC.DragRace SmallStruct_WhereSelectOrderByTakeMinBenchmarks +$Env:Platform = 'x64'; dotnet run -c Release --project .\NullGC.DragRace\NullGC.DragRace.csproj +if (!$?) { throw } Pop-Location diff --git a/scripts/Test.ps1 b/scripts/Test.ps1 index 2cbfc4e..5e08fa9 100644 --- a/scripts/Test.ps1 +++ b/scripts/Test.ps1 @@ -1,17 +1,21 @@ . $PSScriptRoot\Variables.ps1 -pushd $SolutionDir -$Env:Platform = '' -foreach ($project in $Tests) -{ - dotnet test -c Debug -a x86 .\$project\$project.csproj - dotnet test -c Release -a x86 .\$project\$project.csproj -} +Push-Location $SolutionDir + +# the GHA setup-dotnet action currently not support specify architecture, and x86 SDK is not installed. +# $Env:Platform = '' +# foreach ($project in $Tests) +# { +# dotnet test -c Debug -a x86 .\$project\$project.csproj +# dotnet test -c Release -a x86 .\$project\$project.csproj +# } $Env:Platform = 'x64' foreach ($project in $Tests) { dotnet test -c Debug -a x64 .\$project\$project.csproj + if (!$?) { throw } dotnet test -c Release -a x64 .\$project\$project.csproj + if (!$?) { throw } } -popd +Pop-Location