Files
AX-Copilot-Codex/scripts/release-gate.ps1

43 lines
1.0 KiB
PowerShell

param(
[switch]$SkipFullTest
)
$ErrorActionPreference = "Stop"
function Invoke-Step {
param(
[Parameter(Mandatory = $true)][string]$Name,
[Parameter(Mandatory = $true)][scriptblock]$Action
)
Write-Host ""
Write-Host "==> $Name"
& $Action
if ($LASTEXITCODE -ne 0) {
throw "Step failed: $Name"
}
}
Write-Host "Release gate started"
Write-Host "Workspace: $PSScriptRoot\.."
Push-Location (Join-Path $PSScriptRoot "..")
try {
Invoke-Step -Name "Build (warnings/errors gate)" -Action { dotnet build }
Invoke-Step -Name "Parity benchmark suite" -Action { dotnet test --filter "Suite=ParityBenchmark" }
Invoke-Step -Name "Replay stability suite" -Action { dotnet test --filter "Suite=ReplayStability" }
if (-not $SkipFullTest) {
Invoke-Step -Name "Full test suite" -Action { dotnet test }
} else {
Write-Host ""
Write-Host "==> Full test suite skipped by -SkipFullTest"
}
Write-Host ""
Write-Host "Release gate passed"
}
finally {
Pop-Location
}