Files
herdr/scripts/windows_check.ps1
T
JJ Liebig 50ce4ec2dd fix: run the full applicable test suite on windows (#3660)
* fix: run the full applicable test suite on windows

* test: remove redundant test shell assignment

* test: make endpoint and metadata fixtures deterministic

* test: tolerate exited servers during windows probe cleanup
2026-09-05 21:39:32 +03:00

49 lines
1.1 KiB
PowerShell

param(
[ValidateSet("lint", "check")]
[string]$Mode = "check"
)
$ErrorActionPreference = "Stop"
function Invoke-Checked {
param([string]$Command, [string[]]$Arguments)
& $Command @Arguments
if ($LASTEXITCODE -ne 0) {
throw "command failed with exit code $LASTEXITCODE`: $Command $($Arguments -join ' ')"
}
}
function Invoke-CargoWithZigCacheRecovery {
param([string[]]$Arguments)
& cargo @Arguments
if ($LASTEXITCODE -eq 0) {
return
}
Write-Warning "cargo compile failed; clearing Zig build caches and retrying once"
Remove-Item -Recurse -Force .zig-cache -ErrorAction SilentlyContinue
Remove-Item -Recurse -Force vendor/libghostty-vt/.zig-cache -ErrorAction SilentlyContinue
Remove-Item -Recurse -Force vendor/libghostty-vt/zig-out -ErrorAction SilentlyContinue
Invoke-Checked cargo $Arguments
}
Invoke-Checked cargo @("fmt", "--check")
Invoke-CargoWithZigCacheRecovery @(
"clippy",
"--bin",
"herdr",
"--locked",
"--",
"-D",
"warnings"
)
if ($Mode -eq "lint") {
return
}
Invoke-Checked just @("test")
Invoke-Checked cargo @("build", "--locked")