$ErrorActionPreference = "Stop"
cd C:\SecureGuard
Write-Host "`n=== COMMIT CHECK ===" -ForegroundColor Cyan
$commit = git rev-parse HEAD
Write-Host $commit
if ($commit -ne "9bedd234860baf57e289250fc07a0d962bd4c33c") {
throw "STOP: неправильный commit. Ожидался 9bedd234860baf57e289250fc07a0d962bd4c33c"
}
Write-Host "`n=== WORKTREE ===" -ForegroundColor Cyan
git status --short
Write-Host "`n=== SDK ===" -ForegroundColor Cyan
dotnet --version
Write-Host "`n=== RESTORE ===" -ForegroundColor Cyan
dotnet restore SecureGuard.sln --locked-mode
Write-Host "`n=== DEBUG BUILD ===" -ForegroundColor Cyan
dotnet build SecureGuard.sln -c Debug --no-restore
Write-Host "`n=== DEBUG TESTS ===" -ForegroundColor Cyan
dotnet test SecureGuard.sln -c Debug --no-build
Write-Host "`n=== RELEASE BUILD ===" -ForegroundColor Cyan
dotnet build SecureGuard.sln -c Release --no-restore
New-Item -ItemType Directory -Force -Path .\artifacts\test-results | Out-Null
Write-Host "`n=== RELEASE TESTS ===" -ForegroundColor Cyan
dotnet test SecureGuard.sln `
-c Release `
--no-build `
--logger "trx;LogFileName=SecureGuard.Tests.trx" `
--results-directory .\artifacts\test-results
Write-Host "`n=== DONE ===" -ForegroundColor Green