mirror of
https://github.com/tobi/disktree.git
synced 2026-11-28 08:00:53 +00:00
disktree: test: build and check the Windows setup on every pull request
CI compiled nothing of the installer, so a broken disktree.iss would first fail inside a release, after its draft exists, and the Arm64 setup had never been built at all. The Windows job now compiles the x64 setup and the Windows aarch64 job the Arm64 one; both run check-setup.ps1, which installs it silently for the current user, checks the exe, Start menu and desktop shortcuts and the uninstall entry, installs again as an upgrade (one entry left), uninstalls and checks nothing remains. install-inno.ps1 takes over the pinned, hash-checked Inno Setup install from release.yml and now fails on a non-zero installer exit or a missing ISCC.exe instead of leaving the next step to report it. Verified locally on Windows 11 x64: both scripts pass, and the CI Installer step body, run as written, compiles a 0.0.0 setup and reports "setup installs, upgrades and uninstalls cleanly". Upgrading while disktree runs closes it through Restart Manager without a reboot. The Arm64 job has not run yet.
This commit is contained in:
@@ -117,6 +117,18 @@ jobs:
|
||||
throw "disktree.exe has no embedded icon"
|
||||
}
|
||||
|
||||
# Here rather than only at release time, so a broken installer script
|
||||
# fails the pull request instead of a release half-way through.
|
||||
- name: Installer
|
||||
shell: pwsh
|
||||
run: |
|
||||
packaging/windows/install-inno.ps1 -Dir "$env:RUNNER_TEMP\inno"
|
||||
& "$env:RUNNER_TEMP\inno\ISCC.exe" /Q /DAppVersion=0.0.0 `
|
||||
/DArch=x86_64 packaging/windows/disktree.iss
|
||||
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
|
||||
packaging/windows/check-setup.ps1 `
|
||||
-Setup target/bundle/disktree-0.0.0-x86_64-windows-setup.exe
|
||||
|
||||
# The other half of each release: the same tests on the architectures
|
||||
# the release builds for but the jobs above do not run on.
|
||||
other-architectures:
|
||||
@@ -152,3 +164,16 @@ jobs:
|
||||
|
||||
- name: Test
|
||||
run: cargo xtask test
|
||||
|
||||
# The Arm64 setup, which no other job builds before a release does.
|
||||
- name: Installer
|
||||
if: runner.os == 'Windows'
|
||||
shell: pwsh
|
||||
run: |
|
||||
cargo build --release --locked -p disktree-app
|
||||
packaging/windows/install-inno.ps1 -Dir "$env:RUNNER_TEMP\inno"
|
||||
& "$env:RUNNER_TEMP\inno\ISCC.exe" /Q /DAppVersion=0.0.0 `
|
||||
/DArch=aarch64 packaging/windows/disktree.iss
|
||||
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
|
||||
packaging/windows/check-setup.ps1 `
|
||||
-Setup target/bundle/disktree-0.0.0-aarch64-windows-setup.exe
|
||||
|
||||
@@ -252,23 +252,7 @@ jobs:
|
||||
|
||||
- name: Install Inno Setup
|
||||
shell: pwsh
|
||||
# Pinned and checked rather than the runner's own: the two images
|
||||
# carry different, older versions.
|
||||
env:
|
||||
INNO_URL: https://github.com/jrsoftware/issrc/releases/download/is-7_1_0/innosetup-7.1.0-x64.exe
|
||||
INNO_SHA256: 0362a383ed217d4c4239b5933866dd96d3eb2102737da92f80f6057a4b40df2f
|
||||
run: |
|
||||
$setup = "$env:RUNNER_TEMP/innosetup.exe"
|
||||
$dir = "$env:RUNNER_TEMP/inno"
|
||||
Invoke-WebRequest $env:INNO_URL -OutFile $setup
|
||||
$hash = (Get-FileHash $setup -Algorithm SHA256).Hash.ToLower()
|
||||
if ($hash -ne $env:INNO_SHA256) {
|
||||
throw "Inno Setup download has SHA256 $hash"
|
||||
}
|
||||
Start-Process $setup -Wait -ArgumentList `
|
||||
'/VERYSILENT', '/SUPPRESSMSGBOXES', '/NORESTART', '/SP-',
|
||||
'/CURRENTUSER', "/DIR=$dir"
|
||||
"$dir" >> $env:GITHUB_PATH
|
||||
run: packaging/windows/install-inno.ps1 -Dir "$env:RUNNER_TEMP\inno"
|
||||
|
||||
- name: Installer
|
||||
id: installer
|
||||
|
||||
Reference in New Issue
Block a user