Reject native verification parse errors before launch and fix split dispatch branch
This commit is contained in:
@@ -154,7 +154,6 @@ try {
|
|||||||
Check 'partial2-exact-restored' (Same $partialBoard (Board (Save 'partial2-restored') 2)) 'OriginalIDs positions membership collected counted camera exact'
|
Check 'partial2-exact-restored' (Same $partialBoard (Board (Save 'partial2-restored') 2)) 'OriginalIDs positions membership collected counted camera exact'
|
||||||
}
|
}
|
||||||
CountRemaining $stage|Out-Null
|
CountRemaining $stage|Out-Null
|
||||||
} else {CountRemaining $stage|Out-Null}
|
|
||||||
} else {
|
} else {
|
||||||
if($original.groups.Count-gt1){MergeReal $stage "stage-$stage-merge"|Out-Null}
|
if($original.groups.Count-gt1){MergeReal $stage "stage-$stage-merge"|Out-Null}
|
||||||
if($splitSizes.ContainsKey($stage)){SplitReal $stage $splitSizes[$stage] "stage-$stage-split"|Out-Null}
|
if($splitSizes.ContainsKey($stage)){SplitReal $stage $splitSizes[$stage] "stage-$stage-split"|Out-Null}
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ $record=[ordered]@{milestone='Final';sourceCommit=(& git rev-parse HEAD);sourceD
|
|||||||
function Check([string]$Id,[bool]$Passed,[string]$Actual){$checks.Add(@{id=$Id;passed=$Passed;actual=$Actual});if(!$Passed){throw "Final check failed: $Id ($Actual)"}}
|
function Check([string]$Id,[bool]$Passed,[string]$Actual){$checks.Add(@{id=$Id;passed=$Passed;actual=$Actual});if(!$Passed){throw "Final check failed: $Id ($Actual)"}}
|
||||||
try {
|
try {
|
||||||
Check 'clean-frozen-source' (!$record.sourceDirty) $record.sourceCommit
|
Check 'clean-frozen-source' (!$record.sourceDirty) $record.sourceCommit
|
||||||
|
& pwsh -NoProfile -File (Join-Path $PSScriptRoot 'test-final-syntax.ps1') -EvidenceDir (Join-Path $EvidenceDir 'ScriptSyntax')
|
||||||
|
Check 'native-script-parser-clean' ($LASTEXITCODE-eq0) 'All Android verification PowerShell files parsed without errors before native launch'
|
||||||
$build=Get-Content -LiteralPath (Join-Path $EvidenceDir 'androidbuild-evidence.json') -Raw|ConvertFrom-Json
|
$build=Get-Content -LiteralPath (Join-Path $EvidenceDir 'androidbuild-evidence.json') -Raw|ConvertFrom-Json
|
||||||
Check 'exact-final-build' ($build.status-eq'passed'-and$build.exitCode-eq0-and!$build.sourceDirty-and!$build.sourceDirtyEnd-and$build.sourceCommit-eq$record.sourceCommit-and$build.sourceCommitEnd-eq$record.sourceCommit-and$build.apkSha256-eq$record.apkSha256) $record.apkSha256
|
Check 'exact-final-build' ($build.status-eq'passed'-and$build.exitCode-eq0-and!$build.sourceDirty-and!$build.sourceDirtyEnd-and$build.sourceCommit-eq$record.sourceCommit-and$build.sourceCommitEnd-eq$record.sourceCommit-and$build.apkSha256-eq$record.apkSha256) $record.apkSha256
|
||||||
$standard=Join-Path $projectRoot 'artifacts/android/MagnetismHeroes.apk'
|
$standard=Join-Path $projectRoot 'artifacts/android/MagnetismHeroes.apk'
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
param([Parameter(Mandatory)][string]$EvidenceDir,[string[]]$Sources)
|
||||||
|
$ErrorActionPreference='Stop'
|
||||||
|
New-Item -ItemType Directory -Path $EvidenceDir -Force|Out-Null
|
||||||
|
if(!$Sources){$Sources=@(Get-ChildItem $PSScriptRoot -Filter '*.ps1'|Select-Object -ExpandProperty FullName)}
|
||||||
|
$results=@(foreach($source in $Sources){
|
||||||
|
$errors=$null
|
||||||
|
[Management.Automation.Language.Parser]::ParseFile($source,[ref]$null,[ref]$errors)|Out-Null
|
||||||
|
@{source=$source;passed=($errors.Count-eq0);errors=@($errors|Select-Object ErrorId,Message,@{n='line';e={$_.Extent.StartLineNumber}})}
|
||||||
|
})
|
||||||
|
$passed=$results.Count-gt0-and@($results|Where-Object passed -ne $true).Count-eq0
|
||||||
|
@{passed=$passed;checks=$results}|ConvertTo-Json -Depth 8|Set-Content (Join-Path $EvidenceDir 'syntax-result.json')
|
||||||
|
if(!$passed){exit 1};exit 0
|
||||||
Reference in New Issue
Block a user