Skip to content

Commit

Permalink
Warn for Windows powershell (#3036)
Browse files Browse the repository at this point in the history
- Also, fail script if dotnet build fails
  • Loading branch information
andystaples authored Feb 28, 2025
1 parent 82e104b commit 2790214
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
12 changes: 11 additions & 1 deletion test/e2e/Tests/build-e2e-test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ param(
$SkipBuild
)

if ($PSVersionTable.PSEdition -ne 'Core') {
Write-Warning "You are not running PowerShell Core. Please switch to PowerShell Core (>= PS 6) for better compatibility and performance."
Write-Warning "See https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell?view=powershell-7.5"
exit 1
}

$ErrorActionPreference = "Stop"

$ProjectBaseDirectory = "$PSScriptRoot\..\..\..\"
Expand Down Expand Up @@ -119,7 +125,9 @@ if (!$SkipBuild)
$BuildOutputLocation = Resolve-Path $BuildOutputLocation
Get-ChildItem -Path $BuildOutputLocation -Include * -File -Recurse | ForEach-Object { $_.Delete()}
dotnet build -c Debug "$WebJobsExtensionProjectDirectory\WebJobs.Extensions.DurableTask.csproj" --output $BuildOutputLocation


if ($LASTEXITCODE -ne 0) { Set-Location $PSScriptRoot; throw "WebJobs Extension build failed" }

Write-Host "Moving nupkg from WebJobs extension to $AppPackageLocation"
Set-Location $BuildOutputLocation
dotnet nuget push *.nupkg --source $AppPackageLocation
Expand Down Expand Up @@ -147,6 +155,8 @@ if (!$SkipBuild)
Write-Host "Building app project"
dotnet clean app.csproj
dotnet build app.csproj

if ($LASTEXITCODE -ne 0) { Set-Location $PSScriptRoot; throw "Test app build failed." }
}

Set-Location $PSScriptRoot
Expand Down
6 changes: 6 additions & 0 deletions test/e2e/Tests/start-emulators.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ param(
$NoWait
)

if ($PSVersionTable.PSEdition -ne 'Core') {
Write-Warning "You are not running PowerShell Core. Please switch to PowerShell Core (>= PS 6) for better compatibility and performance."
Write-Warning "See https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell?view=powershell-7.5"
exit 1
}

if (Test-Path($EmulatorStartDir)) {
Set-Location $EmulatorStartDir
}
Expand Down

0 comments on commit 2790214

Please sign in to comment.