Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
15 changes: 14 additions & 1 deletion scripts/test-windows-installer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -67,6 +72,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)
Expand All @@ -77,6 +84,7 @@ function global:Expand-Archive {
}
}

$global:InstallerTestOutput = @()
try {
Write-Host '--- install succeeds and cleans up'
$global:InstallerTestHoldExtractedBinary = $false
Expand Down Expand Up @@ -106,6 +114,11 @@ try {
Write-Host '--- skipping held-file cleanup case: open files can be deleted on this platform'
}
}
catch {
Write-Host '--- installer output'
$global:InstallerTestOutput | ForEach-Object { Write-Host " $_" }
Comment thread
cubic-dev-ai[bot] marked this conversation as resolved.
Resolved
throw
}
finally {
if ($global:InstallerTestOpenHandle) {
$global:InstallerTestOpenHandle.Dispose()
Expand Down
Loading