From 37dbc38e1afe63444f5f4050b84197f23952d19b Mon Sep 17 00:00:00 2001 From: Ash Godfrey Date: Thu, 22 Oct 2026 20:34:19 +0100 Subject: [PATCH 1/4] ci: use literal shells for the Windows installer matrix [skip changelog] --- .github/workflows/test.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d5b75aece..e339f52bb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -192,8 +192,13 @@ jobs: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - - name: Test generated Windows installer - shell: ${{ matrix.shell }} + - name: Test generated Windows installer (powershell) + if: matrix.shell == 'powershell' + shell: powershell + run: ./scripts/test-windows-installer.ps1 + - name: Test generated Windows installer (pwsh) + if: matrix.shell == 'pwsh' + shell: pwsh run: ./scripts/test-windows-installer.ps1 test-cli: if: always() && needs.detect-targets.outputs.run-cli == 'true' From e4c9b88c93ac87cbd32d771c99917825be2db599 Mon Sep 17 00:00:00 2001 From: Ash Godfrey Date: Thu, 22 Oct 2026 20:37:09 +0100 Subject: [PATCH 2/4] ci: load the Archive module before replacing Expand-Archive in the installer test --- scripts/test-windows-installer.ps1 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/test-windows-installer.ps1 b/scripts/test-windows-installer.ps1 index c95aa9d09..b831d53dd 100644 --- a/scripts/test-windows-installer.ps1 +++ b/scripts/test-windows-installer.ps1 @@ -67,6 +67,8 @@ function global:Invoke-WebRequest { Copy-Item -LiteralPath $global:InstallerTestArchive -Destination $OutFile } +Import-Module Microsoft.PowerShell.Archive + $global:InstallerTestOpenHandle = $null function global:Expand-Archive { param([string]$Path, [string]$DestinationPath, [switch]$Force) @@ -77,6 +79,7 @@ function global:Expand-Archive { } } +$output = @() try { Write-Host '--- install succeeds and cleans up' $global:InstallerTestHoldExtractedBinary = $false @@ -106,6 +109,11 @@ try { Write-Host '--- skipping held-file cleanup case: open files can be deleted on this platform' } } +catch { + Write-Host '--- installer output' + $output | ForEach-Object { Write-Host " $_" } + throw +} finally { if ($global:InstallerTestOpenHandle) { $global:InstallerTestOpenHandle.Dispose() From baa5813598c019123ec56251b017c90cbd6de067 Mon Sep 17 00:00:00 2001 From: Ash Godfrey Date: Thu, 22 Oct 2026 20:51:52 +0100 Subject: [PATCH 3/4] chore: capture installer output as it streams in the Windows installer test --- scripts/test-windows-installer.ps1 | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/test-windows-installer.ps1 b/scripts/test-windows-installer.ps1 index b831d53dd..e346a47d0 100644 --- a/scripts/test-windows-installer.ps1 +++ b/scripts/test-windows-installer.ps1 @@ -54,7 +54,12 @@ function Invoke-Installer { } $global:InstallerTestArchive = $Sandbox.Archive $global:InstallerTestDownloads = @() - & $InstallerPath *>&1 | ForEach-Object { "$_" } + $global:InstallerTestOutput = @() + & $InstallerPath *>&1 | ForEach-Object { + $line = "$_" + $global:InstallerTestOutput += $line + $line + } } function global:Invoke-RestMethod { @@ -79,7 +84,6 @@ function global:Expand-Archive { } } -$output = @() try { Write-Host '--- install succeeds and cleans up' $global:InstallerTestHoldExtractedBinary = $false @@ -111,7 +115,7 @@ try { } catch { Write-Host '--- installer output' - $output | ForEach-Object { Write-Host " $_" } + $global:InstallerTestOutput | ForEach-Object { Write-Host " $_" } throw } finally { From 3dc630bd48914404d8946a02f79d00efbdbbfe81 Mon Sep 17 00:00:00 2001 From: Ash Godfrey Date: Thu, 22 Oct 2026 20:55:04 +0100 Subject: [PATCH 4/4] chore: initialize the captured installer output before the test body --- scripts/test-windows-installer.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/test-windows-installer.ps1 b/scripts/test-windows-installer.ps1 index e346a47d0..8428ca494 100644 --- a/scripts/test-windows-installer.ps1 +++ b/scripts/test-windows-installer.ps1 @@ -84,6 +84,7 @@ function global:Expand-Archive { } } +$global:InstallerTestOutput = @() try { Write-Host '--- install succeeds and cleans up' $global:InstallerTestHoldExtractedBinary = $false