Files
craft-launcher/.github/workflows/ci.yml
T
skylar taylor-barrick ed3f54f4e7 ci: test the desktop crates on macOS for full-ci pull requests (#1583)
* ci: test the desktop crates on macOS for full-ci pull requests

A new macOS workflow runs clippy with -D warnings and the tests of artcraft-launcher-native and
artcraft-launcher-ui-egui on macos-15. To save the org's macOS slots, which release builds share,
it runs only on pull requests labelled full-ci.

* Gate Linux-only Nightly test helpers to Linux

Their only callers are Linux tests, so macOS builds of the native tests reported them as dead
code and clippy -D warnings failed there.

* Move complete_nightly_install above the install tests

Clippy's items_after_test_module failed the macOS build: on macOS the Linux-only cleanup test
module after it is compiled out, so this Unix helper was the only item after mod tests. Code
move only.

* Give the redirect-budget test room for late timers on a loaded Mac

On a loaded macOS host with low priority, timer coalescing made the fixture's 5 ms accept polls
take up to 25 ms and its 80 ms response delay take up to 153 ms. With a 130 ms budget, the first
hop then ran out of time before it could redirect, so the second request the test waits for was
never sent. The fixture now waits 600 ms per hop against a 1 s budget. Each hop alone still fits,
and because sleeps never return early, the two hops together always exceed the budget. The
assertions are unchanged.
2026-11-23 19:57:20 +00:00

56 lines
2.7 KiB
YAML

name: CI
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
permissions:
contents: read
# A newer push to a PR branch cancels its older run. Runs on main are never cancelled, so every
# main state that gets a run is checked to the end.
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
# fmt, clippy, tests and the wasm check (`cargo xtask ci`) through the suite's shared gate.
# macOS is not a leg here: the org's 5 macOS slots are shared with release builds, so macos.yml
# runs only on pull requests labelled full-ci, and release.yml builds and checks the macOS packages.
test:
# Tracks @main so suite-wide CI fixes reach every app without a PR in each repository.
uses: storytold/craft-common-actions/.github/workflows/gate.yml@main
with:
os: '["ubuntu-24.04","windows-latest"]'
# The launcher bundles its own fonts (assets/fonts/) and builds nothing from craft-fonts.
craft-fonts-ref: ""
# `cargo xtask ci` and the Windows command run cargo test, not nextest.
tools: ""
# egui/winit/wgpu headers. The tray (ksni) and notifications (notify-rust over zbus) are
# pure-Rust D-Bus clients, so no GTK, appindicator, xdo or libdbus packages are needed.
packages: libxkbcommon-dev libwayland-dev libx11-dev libxrandr-dev libxi-dev libgl1-mesa-dev
# Windows checks what differs by platform: clippy and the tests.
windows-command: |
fixture_directory="$(cygpath -aw "$RUNNER_TEMP/craft-launcher-signed-fixture")"
export CRAFT_NIGHTLY_SIGNED_FIXTURE="$fixture_directory\pwsh.exe"
export CRAFT_NIGHTLY_SIGNED_FIXTURE_REQUIRED=1
pwsh -NoLogo -NoProfile -NonInteractive -File packaging/windows/test-signed-test-fixture.ps1 -OutputDirectory "$fixture_directory.checks"
pwsh -NoLogo -NoProfile -NonInteractive -File packaging/windows/prepare-signed-test-fixture.ps1 -Destination "$fixture_directory"
cargo clippy --workspace --all-targets --locked -- -D warnings
cargo test --workspace --locked
# The browser build, as the release makes it (size gate and relative-URL check included), and
# clippy for wasm32. Its own cache: another target and the wasm-release profile.
web:
# Tracks @main so suite-wide CI fixes reach every app without a PR in each repository.
uses: storytold/craft-common-actions/.github/workflows/gate.yml@main
with:
cache-version: v1-web
craft-fonts-ref: ""
tools: trunk@0.21.14
command: |
cargo clippy -p artcraft-launcher-core -p artcraft-launcher-web --target wasm32-unknown-unknown --locked -- -D warnings
packaging/web/package.sh