diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-01-23 03:51:44 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-01-23 03:51:44 +0800 |
| commit | ab3e1867bf54f6dbb10b80aac159ad52303166a3 (patch) | |
| tree | 46a0f8123eecd3e61825b7a043036575057ae0f9 /deploy.ps1 | |
| parent | 25eb411a2e4c4207fbd8111e68a520ff20cbda73 (diff) | |
Add pre-build validation to deployment scripts
Diffstat (limited to 'deploy.ps1')
| -rw-r--r-- | deploy.ps1 | 23 |
1 files changed, 22 insertions, 1 deletions
@@ -5,11 +5,32 @@ $scriptPath = $MyInvocation.MyCommand.Path $scriptDir = Split-Path $scriptPath -Parent Set-Location $scriptDir +# Test core library +cargo test --manifest-path ..\VersionControl\Cargo.toml --workspace +if ($LASTEXITCODE -ne 0) { + Write-Warning "Core library tests failed. Aborting build." + exit 1 +} + +# Test workspace +cargo test --workspace +if ($LASTEXITCODE -ne 0) { + Write-Warning "Workspace tests failed. Aborting build." + exit 1 +} + +# Check if git worktree is clean +$gitStatus = git status --porcelain +if ($gitStatus) { + Write-Warning "Git worktree is not clean. Commit or stash changes before building." + exit 1 +} + # Check for ISCC $isccPath = Get-Command ISCC -ErrorAction SilentlyContinue if (-not $isccPath) { Write-Warning '"Inno Setup" not installed. (https://jrsoftware.org/isinfo.php)' - exit + exit 1 } # Build |
