Files
hermes-agent/.github/workflows/install-e2e-windows-run.yml
T

118 lines
5.0 KiB
YAML

name: Install & Update E2E — Windows (reusable)
# Runs ONE Windows desktop update route against ONE starting point, with a
# real install (the published Hermes-Setup.exe: git, uv, a managed Python,
# Node, the venv, the desktop build) behind it.
#
# The Windows sibling of install-e2e-run.yml. There is no bubblewrap here, so
# tests/install/windows/install-update-e2e.ps1 fakes GitHub with git's own
# transport rewrite (an isolated GIT_CONFIG_GLOBAL carrying
# url.<file://fake.git>.insteadOf for both hardcoded repo URLs) instead of a
# MITM proxy — the installer and updater run verbatim against their real URLs
# and land on a local bare repo the driver controls. The bootstrap installer
# itself is a GUI with no headless mode, so AutoHotkey clicks it.
#
# Call it:
#
# jobs:
# windows-desktop:
# uses: ./.github/workflows/install-e2e-windows-run.yml
# with:
# route: desktop
on:
workflow_call:
inputs:
route:
description: 'Update path to exercise. desktop = the desktop app''s builtin update hand-off (scripts/desktop-update.ps1). TODO: update (hermes update), installer (re-run the bootstrap installer).'
required: false
type: string
default: desktop
installer-url:
description: 'Bootstrap installer to install with. Default: the latest published one — what a user downloads today.'
required: false
type: string
default: https://hermes-assets.nousresearch.com/Hermes-Setup.exe
timeout-minutes:
description: 'Job timeout. A cold run installs real toolchains and builds the desktop app.'
required: false
type: number
default: 75
permissions:
contents: read
jobs:
e2e:
name: ${{ inputs.route }} from published installer
runs-on: windows-latest
timeout-minutes: ${{ inputs.timeout-minutes }}
steps:
# Full history + tags: the driver seeds its fake GitHub from this
# checkout (all origin branches for the installer's commit pin, release
# tags for the starting base) and promotes HEAD as the update target.
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- name: Restore cached test tools
id: test-tools-cache
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
with:
path: ${{ runner.temp }}\test-bins
key: test-bins-${{ runner.os }}-v1
# AutoHotkey drives the installer GUI; ffmpeg records the screen so a
# failed click is diagnosable from the artifact instead of by guesswork.
# Everything lands under RUNNER_TEMP: an untracked dir inside the
# checkout makes the tree dirty, and the driver refuses a dirty tree
# (the update target must be a reviewable commit).
- name: Install AutoHotkey v2 and ffmpeg
if: steps.test-tools-cache.outputs.cache-hit != 'true'
shell: pwsh
run: |
$bins = "$env:RUNNER_TEMP\test-bins"
New-Item -ItemType Directory -Path $bins\autohotkey, $bins\ffmpeg -Force | Out-Null
# AutoHotkey: copy its whole v2 directory so helper exes/dlls come along.
winget install -e --id AutoHotkey.AutoHotkey --silent --accept-source-agreements --accept-package-agreements --disable-interactivity
$ahkDir = "$env:ProgramW6432\AutoHotkey\v2"
if (-not (Test-Path $ahkDir)) {
throw "AutoHotkey install directory not found: $ahkDir"
}
Copy-Item -Path "$ahkDir\*" -Destination $bins\autohotkey -Recurse -Force
winget install -e --id Gyan.FFmpeg --silent --accept-source-agreements --accept-package-agreements --disable-interactivity --location "$env:RUNNER_TEMP\ffmpeg_dir"
Copy-Item -Path "$env:RUNNER_TEMP\ffmpeg_dir\*\*" -Destination $bins\ffmpeg -Recurse -Force
- name: Add test tools to PATH
shell: pwsh
run: |
Add-Content -Path $env:GITHUB_PATH -Value "$env:RUNNER_TEMP\test-bins\autohotkey"
Add-Content -Path $env:GITHUB_PATH -Value "$env:RUNNER_TEMP\test-bins\ffmpeg\bin"
- name: Run install + update E2E
shell: pwsh
run: |
tests/install/windows/install-update-e2e.ps1 `
-Route '${{ inputs.route }}' `
-InstallerUrl '${{ inputs.installer-url }}'
env:
# Outside the workspace on purpose: the driver refuses to run on a
# dirty tree, and logs written into the repo would be what makes it
# dirty.
HERMES_E2E_LOG_DIR: ${{ runner.temp }}\e2e-logs
# The installer's own transcript, the AHK click log, the update hand-off
# log, and the screen recording say far more than the assertion that
# tripped when a real install breaks.
- name: Upload logs and recording
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: install-e2e-windows-${{ inputs.route }}-${{ github.sha }}
path: ${{ runner.temp }}\e2e-logs
retention-days: 14
if-no-files-found: ignore