Files
disktree/.github/workflows/ci.yml
T
Abdulwahb Isam c8a9336acb 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.
2026-10-16 09:02:06 +03:00

180 lines
5.6 KiB
YAML

name: CI
on:
push:
branches: [main]
pull_request:
# Pull requests run here, so the token can read and nothing more.
permissions:
contents: read
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
jobs:
check:
name: Lint and test
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v5
# What GPUI links against: windowing (Wayland, X11), input, fonts,
# and the Vulkan loader.
- name: System libraries
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
pkg-config libxkbcommon-dev libxkbcommon-x11-dev libwayland-dev \
libx11-xcb-dev libxcb1-dev libfontconfig-dev libfreetype-dev \
libvulkan-dev libasound2-dev libssl-dev libzstd-dev
# Pinned: the lint gate denies clippy::all and ::pedantic, and a newer
# clippy's new lints are a change to make on purpose, not by surprise.
- uses: dtolnay/rust-toolchain@master
with:
toolchain: "1.97"
components: clippy, rustfmt
- uses: Swatinem/rust-cache@v2
- name: Lint
run: cargo xtask lint
- name: Test
run: cargo xtask test
check-macos:
name: Lint and test (macOS)
# Apple silicon. No system libraries to install, and no Metal toolchain
# either: gpui-kit builds GPUI with runtime shader compilation, so the
# shaders compile when the app starts, not here.
runs-on: macos-15
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@master
with:
toolchain: "1.97"
components: clippy, rustfmt
- uses: Swatinem/rust-cache@v2
- name: Lint
run: cargo xtask lint
- name: Test
run: cargo xtask test
# The app bundle, signed ad hoc: catches a broken Info.plist, icon or
# signature before a release does.
- name: Bundle
run: cargo xtask bundle
windows:
name: Lint and test (Windows)
runs-on: windows-2025
steps:
# Check out with the repository's own line endings, as on Linux.
- run: git config --global core.autocrlf false
- uses: actions/checkout@v5
# Pinned with the Linux job, for the same reason. GPUI needs nothing
# beyond the Windows SDK the runner already has.
- uses: dtolnay/rust-toolchain@master
with:
toolchain: "1.97"
components: clippy, rustfmt
- uses: Swatinem/rust-cache@v2
- name: Lint
run: cargo xtask lint
- name: Test
run: cargo xtask test
- name: Check embedded executable icon
shell: pwsh
run: |
cargo build --release --locked -p disktree-app
Add-Type @'
using System;
using System.Runtime.InteropServices;
public static class ExecutableIcons {
[DllImport("shell32.dll", CharSet = CharSet.Unicode)]
public static extern uint ExtractIconEx(
string file, int index, IntPtr[] large, IntPtr[] small, uint count);
}
'@
$exe = (Resolve-Path target/release/disktree.exe).Path
if ([ExecutableIcons]::ExtractIconEx($exe, -1, $null, $null, 0) -lt 1) {
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:
name: Test (${{ matrix.name }})
strategy:
fail-fast: false
matrix:
include:
- { name: Linux aarch64, runner: ubuntu-24.04-arm }
- { name: macOS x86_64, runner: macos-15-intel }
- { name: Windows aarch64, runner: windows-11-arm }
runs-on: ${{ matrix.runner }}
steps:
- if: runner.os == 'Windows'
run: git config --global core.autocrlf false
- uses: actions/checkout@v5
- name: System libraries
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
pkg-config libxkbcommon-dev libxkbcommon-x11-dev libwayland-dev \
libx11-xcb-dev libxcb1-dev libfontconfig-dev libfreetype-dev \
libvulkan-dev libasound2-dev libssl-dev libzstd-dev
- uses: dtolnay/rust-toolchain@master
with:
toolchain: "1.97"
- uses: Swatinem/rust-cache@v2
- 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