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
8 changes: 6 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,13 @@ jobs:
cache: true

- name: Install Xvfb
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y xvfb xauth
if command -v xvfb-run >/dev/null 2>&1 && command -v xauth >/dev/null 2>&1; then
exit 0
fi
sudo apt-get -o Acquire::Retries=3 update
sudo apt-get -o Acquire::Retries=3 install -y --no-install-recommends xvfb xauth

- name: Browser integration race
shell: bash
Expand Down
41 changes: 20 additions & 21 deletions .github/workflows/windows-installer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,18 +115,6 @@ jobs:
$ErrorActionPreference = 'Stop'
go test ./internal/desktopruntime -run TestSelectInteractiveTaskSessionID -count=1

- name: Download and validate exact installer bytes
shell: powershell
run: |
$ErrorActionPreference = 'Stop'
$downloadedInstaller = Join-Path $env:RUNNER_TEMP 'install-downloaded.ps1'
$installerUrl = 'https://raw.githubusercontent.com/${{ github.repository }}/${{ github.sha }}/scripts/install/install.ps1'
& .\scripts\test\test-install-windows-download.ps1 `
-Url $installerUrl `
-ExpectedInstallerPath .\scripts\install\install.ps1 `
-OutputPath $downloadedInstaller
"DOWNLOADED_INSTALLER=$downloadedInstaller" | Out-File -FilePath $env:GITHUB_ENV -Encoding ascii -Append

- name: Run full install and in-place upgrade as standard user
shell: powershell
run: |
Expand Down Expand Up @@ -190,7 +178,7 @@ jobs:
} while ($true)

& .\scripts\test\run-windows-installer-e2e-as-standard-user.ps1 `
-InstallerPath $env:DOWNLOADED_INSTALLER `
-InstallerPath .\scripts\install\install.ps1 `
-Version latest `
-ReleaseBaseUrl $releaseBaseUrl
} finally {
Expand Down Expand Up @@ -262,18 +250,29 @@ jobs:
$checksumPath = "$archivePath.sha256"
[IO.File]::WriteAllText($checksumPath, "$hash agentdock_windows_amd64.zip`n", [Text.UTF8Encoding]::new($false))

$cloudflaredPath = Join-Path $payloadRoot 'cloudflared-windows-amd64.exe'
Invoke-WebRequest `
-UseBasicParsing `
-Uri 'https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-windows-amd64.exe' `
-OutFile $cloudflaredPath
"AMD64_ARCHIVE=$archivePath" | Out-File -FilePath $env:GITHUB_ENV -Encoding ascii -Append
"AMD64_CHECKSUM=$checksumPath" | Out-File -FilePath $env:GITHUB_ENV -Encoding ascii -Append

- name: Download and verify cloudflared compatibility payload
shell: pwsh
run: |
$ErrorActionPreference = 'Stop'
$ProgressPreference = 'SilentlyContinue'
$cloudflaredPath = Join-Path $env:RUNNER_TEMP 'cloudflared-windows-amd64.exe'
$cloudflaredUrl = 'https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-windows-amd64.exe'
for ($attempt = 1; $attempt -le 5; $attempt++) {
try {
Invoke-WebRequest -UseBasicParsing -Uri $cloudflaredUrl -OutFile $cloudflaredPath
break
} catch {
if ($attempt -eq 5) { throw }
Start-Sleep -Seconds 2
}
}
$cloudflaredSignature = Get-AuthenticodeSignature -LiteralPath $cloudflaredPath
if ($cloudflaredSignature.Status -ne [Management.Automation.SignatureStatus]::Valid) {
throw "cloudflared Authenticode signature is invalid: $($cloudflaredSignature.StatusMessage)"
}

"AMD64_ARCHIVE=$archivePath" | Out-File -FilePath $env:GITHUB_ENV -Encoding ascii -Append
"AMD64_CHECKSUM=$checksumPath" | Out-File -FilePath $env:GITHUB_ENV -Encoding ascii -Append
"AMD64_CLOUDFLARED=$cloudflaredPath" | Out-File -FilePath $env:GITHUB_ENV -Encoding ascii -Append

- name: Test Quick Tunnel restart lifecycle
Expand Down
7 changes: 7 additions & 0 deletions scripts/test/ci_workflow_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,16 @@ func TestWindowsInstallerWorkflowHasAlwaysPresentPullRequestGate(t *testing.T) {
"CHANGES_RESULT: ${{ needs.changes.result }}",
"VALIDATE_RESULT: ${{ needs.validate.result }}",
"github.event_name == 'workflow_dispatch' && inputs.test_tag != ''",
"-InstallerPath .\\scripts\\install\\install.ps1",
"name: Download and verify cloudflared compatibility payload",
"for ($attempt = 1; $attempt -le 5; $attempt++)",
"Get-AuthenticodeSignature -LiteralPath $cloudflaredPath",
} {
if !strings.Contains(workflow, want) {
t.Fatalf("Windows Installer workflow must keep a safe pull-request gate; missing %q", want)
}
}
if strings.Contains(workflow, "raw.githubusercontent.com/${{ github.repository }}/${{ github.sha }}/scripts/install/install.ps1") {
t.Fatal("routine Windows installer validation must use the checked-out installer instead of refetching it over the network")
}
}