ci(windows): free build working set before the persist copy (persist OOM) #28

Merged
SilverLABS merged 1 commits from ci/free-before-persist into main 2026-06-10 15:35:35 +00:00

View File

@@ -184,6 +184,15 @@ jobs:
# RUNNER_TEMP is per-job/ephemeral. Keep the latest validated build at a
# stable path so it can be retrieved (e.g. for VM boot-testing) out of band.
New-Item -ItemType Directory -Force 'C:\silvermetal\out' | Out-Null
# The ISO is already built + validated; free the build working set (extracted ISO
# tree + the mounted/expanded install.wim + the 5GB base ISO) BEFORE the ~5GB persist
# copy, or the single-volume runner runs out of space mid-copy. The ISO itself lives
# in RUNNER_TEMP\out (untouched) and the SBOM/SHA uploads read from there too.
$before = [math]::Round((Get-PSDrive C).Free/1GB,1)
Remove-Item "$env:RUNNER_TEMP\smbuild" -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item "$env:RUNNER_TEMP\base.iso" -Force -ErrorAction SilentlyContinue
$after = [math]::Round((Get-PSDrive C).Free/1GB,1)
Write-Host " freed build working set: C: ${before}GB -> ${after}GB before persist"
Copy-Item "$env:RUNNER_TEMP\out\*" 'C:\silvermetal\out\' -Force
Get-ChildItem 'C:\silvermetal\out' | ForEach-Object { Write-Host $_.Name }