Files

71 lines
2.6 KiB
YAML

name: Test and build installer
on:
push:
branches: [main]
tags: ['v*']
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: '3.12'
- run: python -m pip install -e ".[dev]"
- run: python -m pytest -q
build-container:
# Podman 4.9 in the 24.04 image has upstream issue #22078 for keep-id UID 0.
runs-on: ubuntu-26.04-arm
timeout-minutes: 12
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: '3.12'
- name: Verify package installation in the rootless build container
run: python scripts/check-build-container.py
windows-executable:
needs: [test, build-container]
runs-on: windows-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: '3.12'
- run: python -m pip install -e ".[dev]"
- run: python scripts/build_release.py
- name: Smoke test the frozen executable
shell: pwsh
run: |
$reportPath = Join-Path $env:RUNNER_TEMP 'halo-installer-smoke.json'
$installers = @(Get-ChildItem -LiteralPath 'dist' -Filter 'Halo-Steam-Frame-Mod-Setup-*.exe')
if ($installers.Count -ne 1) { throw 'Expected one standalone installer executable' }
$exePath = $installers[0].FullName
$process = Start-Process -FilePath $exePath -ArgumentList @('--self-test-report', ('"' + $reportPath + '"')) -WindowStyle Hidden -Wait -PassThru
if ($process.ExitCode -ne 0) { throw 'Executable smoke test failed' }
$report = Get-Content -LiteralPath $reportPath -Raw | ConvertFrom-Json
if (-not $report.ok) { throw 'Executable did not report success' }
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: HaloFrameSetup-windows
path: dist/*
if-no-files-found: error