Switch the Windows Fleet-maintained app test workflows from windows-latest to windows-11-arm so ARM-native FMAs can be validated. Existing x86/x64 FMAs continue to install and run via Windows 11 on ARM's Prism emulation, and detection is registry-based so it stays architecture-agnostic. Also make the osquery download architecture-aware: pick the native arm64 build on ARM64 runners and fall back to x86_64 otherwise, so osqueryi runs natively rather than under emulation. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Tests** * Expanded test coverage to include Windows 11 ARM64 architecture. The application is now validated on ARM-based systems in addition to traditional x86_64 platforms. * Updated test infrastructure to automatically detect system architecture and download corresponding dependencies, ensuring proper validation across both ARM64 and x86_64 Windows configurations. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
102 lines
3.9 KiB
YAML
102 lines
3.9 KiB
YAML
name: Test Fleet Maintained Apps - Windows
|
|
|
|
on:
|
|
# Note: PR triggers removed - use test-fma-windows-pr-only.yml for PRs
|
|
# This workflow is kept for manual testing of all FMAs via workflow_dispatch
|
|
workflow_dispatch: # Manual trigger
|
|
inputs:
|
|
log_level:
|
|
description: "Log level (debug, info, warn, error)"
|
|
required: false
|
|
default: "info"
|
|
type: choice
|
|
options:
|
|
- debug
|
|
- info
|
|
- warn
|
|
- error
|
|
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
test-fma:
|
|
env:
|
|
LOG_LEVEL: ${{ github.event.inputs.log_level || 'info' }}
|
|
# ARM64 runner so we can validate ARM-native FMAs. x86/x64 FMAs continue to
|
|
# install and run here via Windows 11 on ARM's Prism emulation.
|
|
runs-on: windows-11-arm
|
|
|
|
steps:
|
|
- name: Harden Runner
|
|
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
|
|
with:
|
|
egress-policy: audit
|
|
|
|
- name: Checkout Fleet
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
with:
|
|
repository: fleetdm/fleet
|
|
fetch-depth: 1
|
|
ref: ${{ github.ref }}
|
|
path: fleet
|
|
persist-credentials: false
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
|
|
with:
|
|
go-version-file: "fleet/go.mod"
|
|
|
|
- name: Install osquery windows
|
|
run: |
|
|
Write-Host "Runner architecture: $env:PROCESSOR_ARCHITECTURE"
|
|
# Use the native osquery build for the runner architecture. On
|
|
# windows-11-arm this picks the arm64 zip so osqueryi runs natively
|
|
# rather than under Prism emulation; x86_64 runners keep the x64 zip.
|
|
if ($env:PROCESSOR_ARCHITECTURE -eq "ARM64") {
|
|
$osqueryAsset = "osquery-5.18.1.windows_arm64.zip"
|
|
} else {
|
|
$osqueryAsset = "osquery-5.18.1.windows_x86_64.zip"
|
|
}
|
|
Write-Host "Downloading osquery asset: $osqueryAsset"
|
|
curl -L -o osquery.zip "https://github.com/osquery/osquery/releases/download/5.18.1/$osqueryAsset"
|
|
Expand-Archive -Path osquery.zip -DestinationPath osquery
|
|
Get-ChildItem -Recurse osquery | Where-Object { $_.Name -like "*osquery*" -and $_.Extension -eq ".exe" }
|
|
$osqueryPath = (Get-ChildItem -Recurse osquery | Where-Object { $_.Name -eq "osqueryi.exe" }).Directory.FullName
|
|
echo "Adding to PATH: $osqueryPath"
|
|
echo $osqueryPath | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
|
shell: pwsh
|
|
|
|
- name: Remove pre-installed google chrome
|
|
run: |
|
|
Write-Host "Listing all installed packages containing 'Chrome':"
|
|
Get-Package | Where-Object { $_.Name -like "*Chrome*" } | ForEach-Object {
|
|
Write-Host " - $($_.Name) (Version: $($_.Version))"
|
|
}
|
|
|
|
$uninstallPath = Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*" | Where-Object { $_.DisplayName -like "*Google Chrome*" } | Select-Object -ExpandProperty UninstallString
|
|
if ($uninstallPath) {
|
|
Write-Host "Found Chrome uninstall path: $uninstallPath"
|
|
try {
|
|
$guid = ($uninstallPath -split "/X")[1]
|
|
Write-Host "Uninstalling Chrome MSI with GUID: $guid"
|
|
Start-Process -FilePath "msiexec.exe" -ArgumentList "/X$guid", "/quiet", "/norestart" -Wait -NoNewWindow
|
|
Write-Host "Successfully removed Google Chrome via MSI uninstaller"
|
|
} catch {
|
|
Write-Host "Failed to remove Chrome: $($_.Exception.Message)"
|
|
}
|
|
} else {
|
|
Write-Host "Chrome uninstall path not found in registry"
|
|
}
|
|
shell: pwsh
|
|
|
|
- name: Verify Fleet Maintained Apps windows
|
|
run: |
|
|
ls "C:\Program Files"
|
|
cd fleet
|
|
go run ./cmd/maintained-apps/validate
|
|
shell: pwsh
|