Bind Android smoke to build provenance and actual PCM assertions

This commit is contained in:
NINI
2026-10-05 03:46:17 +09:00
parent d656efe0dc
commit 4936180e45
7 changed files with 239 additions and 11 deletions
+8 -2
View File
@@ -45,8 +45,13 @@ try {
if ($LASTEXITCODE -ne 0 -or !(Test-Path -LiteralPath $apkPath)) { throw 'Android build failed or produced no APK.' }
$record.apk = $apkPath
$record.apkSha256 = (Get-FileHash -LiteralPath $apkPath -Algorithm SHA256).Hash
& (Join-Path $PSScriptRoot 'android/inspect-apk.ps1') -ApkPath $apkPath -EvidenceDir $evidenceDir
& (Join-Path $PSScriptRoot 'android/inspect-apk.ps1') -ApkPath $apkPath -EvidenceDir $evidenceDir -SourceCommit $record.sourceCommit -SourceDirty $record.sourceDirty -MetadataName 'apk-metadata.json'
$record.apkMetadata = Join-Path $evidenceDir 'apk-metadata.json'
$record.sourceCommitEnd = (& git rev-parse HEAD)
& git update-index --refresh | Out-Null
$record.sourceDirtyEnd = [bool](& git status --porcelain)
$record.trackedDiffEnd = @(& git diff --name-only HEAD)
if ($record.sourceDirty -or $record.sourceDirtyEnd -or $record.sourceCommitEnd -ne $record.sourceCommit) { throw 'Source changed during the Android build or is dirty.' }
if ($Milestone -eq 'Final') {
Copy-Item -LiteralPath $apkPath -Destination (Join-Path $projectRoot 'artifacts/android/MagnetismHeroes.apk')
}
@@ -54,8 +59,9 @@ try {
$smokeScript = Join-Path $PSScriptRoot 'android/smoke.ps1'
if (!(Test-Path -LiteralPath $smokeScript)) { throw 'Android smoke verification has not been implemented yet.' }
$record.command = "pwsh -NoProfile -File tools/android/smoke.ps1 -ApkPath $apkPath -Milestone $Milestone -EvidenceDir $evidenceDir"
& pwsh -NoProfile -File $smokeScript -ApkPath $apkPath -Milestone $Milestone -EvidenceDir $evidenceDir
& pwsh -NoProfile -File $smokeScript -ApkPath $apkPath -Milestone $Milestone -EvidenceDir $evidenceDir *> $logPath
$record.exitCode = $LASTEXITCODE
Get-Content -LiteralPath $logPath | Select-Object -Last 5 | Write-Host
if ($LASTEXITCODE -ne 0) { throw "Android smoke verification exited $LASTEXITCODE." }
}
$record.status = 'passed'