Files
filmcraft/.github/workflows/ci-windows.yml
cb9783ba1a CI (Windows): clippy and tests of the crates with Windows-only code (#4649)
* CI (Windows): clippy and tests of the crates with Windows-only code

A Windows leg through the shared gate and changed-paths workflows, as
LightCraft has: pull requests and pushes to main that touch the Windows
code (WASAPI audio, the graphics test start, Media Foundation / D3D11
decoding, their manifests and the lockfile), and pull requests labelled
full-ci. Nothing ran these crates' tests on Windows before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(filmcraft): accept a reset when the control server drops an expired connection

The first Windows run of the new CI leg failed unterminated_request_releases_its_slot:
Windows ended the timed-out connection with a reset (os error 10054), not a close, so
read_to_string returned ConnectionReset. Either way the client got no reply. Bytes read
before a reset stay in the string, so the no-stale-reply check still applies.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(ui-egui): let the drag-while-playing test wait for frames on a busy runner

The Windows leg (#4649) failed program_monitor_plays_on_while_a_value_is_dragged once: in 90
passes (~1.5 s) the workers finished no frame at a newer revision, so only frame 23 showed. It
passed in the run before. The test now drags until five frames have shown, for up to ~10 s, so a
picture held for the whole drag (the #1673 bug) still fails.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* ci(windows): run the Windows leg's tests under nextest

`cargo test` runs all of a binary's tests in one process, so they share
rayon's global pool and one test's work waits behind another's. The UI
binary's drag-while-playing test failed on one of two attempts at the same
commit (run 43007266199). On a Windows 11 sandbox it passed in six runs:
alone, with the whole binary, pinned to 1, 2 or 4 cores, and with a
one-thread rayon pool. The last run did fail another timing-bound test
(proxy creation, no proxies after ~8 s), which shows how tests in one
process hold each other up.

The Linux gate (`cargo xtask ci`) already uses nextest: each test in its
own process, with .config/nextest.toml's groups. The gate installs
cargo-nextest 0.9.150 on every OS, and the targets are the same
(--lib --bins --tests; no doctests on either leg's test step).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* ci(windows): fix main's first Windows-only clippy error; drop the moved h264 crate

The Windows leg's first run against current main stopped at
crates/engine/src/lib.rs: `let mut dir = DirBuilder::new()` (#4264) is
only mutated on Unix, where it sets the folder's mode, so on Windows
`-D warnings` turns the unused `mut` into an error. The builder is now
made per platform. Nothing compiled Windows code on main until this leg.

crates/h264 moved to craft-libs (504fe9fc5), so `-p filmcraft-h264` no
longer matches a package and `crates/h264/*` no longer exists: both are
removed from the leg.

On a Windows 11 sandbox at main merged into this branch (c7ef3f96) with
this change: `cargo fmt --all --check` passes, the leg's clippy command
for its six packages passes, and filmcraft-engine's lib tests pass (907).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(nextest): run the real-time play_ahead tests with nothing beside them

On the Windows leg, two play_ahead tests failed with silence where
frames were due: plays_every_frame_in_order_from_the_start at frame
27648, and a_device_with_other_channels_plays_the_channels_both_have at
frame 1024, two callbacks in, after a 30 ms head start in which the
mixer should have filled its 200 ms lead at once. The mixer thread only
sleeps when its ring is full, so it wasn't scheduled: nextest runs a
test process per core, and these tests need a thread on time against a
wall-clock device. They get the same rule as render's mixer_perf. The
other 2531 tests passed, the drag-while-playing test among them
(run 43270273462).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: FredApps <FredApps@users.noreply.github.com>
2026-11-12 20:30:24 +01:00

77 lines
3.6 KiB
YAML

name: CI (Windows)
# The Windows leg of the gate: clippy and the tests of the crates with Windows-only code, on pull
# requests and pushes to main that touch that code, and on pull requests labelled `full-ci`.
# The Linux gate (ci.yml) still runs everything else on every pull request.
#
# Most bug reports come from Windows, and code there differs: WASAPI audio (the scrub output and
# playback, #2633), the graphics test start and the registry driver lookup (#1061), Media
# Foundation and D3D11 decoding (crates/platform). Nothing else runs these crates' tests on
# Windows. Not the full `cargo xtask ci`: on a cold windows-latest runner that is well over an
# hour, and its wasm, layering and asset steps don't differ by platform.
on:
push:
branches: [main]
pull_request:
# `labeled`: adding `full-ci` starts it. Other labels skip (see concurrency and the scope job).
types: [opened, synchronize, reopened, labeled]
workflow_dispatch:
permissions:
contents: read
# Its own group, so the Windows leg never cancels the Linux gate. A newer push to a PR branch
# cancels its older run; a label other than `full-ci` gets a group of its own, so it cancels nothing.
concurrency:
group: ci-windows-${{ github.event_name == 'pull_request' && github.ref || github.run_id }}${{ github.event.action == 'labeled' && github.event.label.name != 'full-ci' && format('-label-{0}', github.run_id) || '' }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
windows-scope:
if: github.event.action != 'labeled' || github.event.label.name == 'full-ci'
uses: storytold/craft-common-actions/.github/workflows/changed-paths.yml@main
with:
label: full-ci
# The crates and files with `cfg(windows)` code or Windows-only behaviour, and what decides
# how they build: their manifests, the lockfile and cargo's configuration (a dependency bump
# can break only Windows).
paths: |
.github/workflows/ci-windows.yml
apps/filmcraft/*
crates/platform/*
crates/media/*
crates/engine/src/autosave*
crates/engine/Cargo.toml
crates/gpu/*
crates/testkit/*
crates/ui-egui/src/frames.rs
crates/ui-egui/src/scrub.rs
crates/ui-egui/src/hooks.rs
crates/ui-egui/src/app/playback.rs
crates/ui-egui/src/app/playback/*
crates/ui-egui/src/app/prefs.rs
crates/ui-egui/tests/it/scrub_*
crates/ui-egui/Cargo.toml
Cargo.toml
Cargo.lock
.cargo/*
gate-windows:
needs: windows-scope
if: needs.windows-scope.outputs.matched == 'true'
# 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: '["windows-latest"]'
# Same craft-fonts commit as ci.yml and release.yml.
craft-fonts-ref: b076417b5880bd4154bd22f00695b1d28c6bea83
timeout-minutes: 120
# The tests run under nextest (the gate installs it), as in `cargo xtask ci` on Linux: each
# test in a process of its own, with .config/nextest.toml's groups. Under `cargo test` the
# tests of one binary share a process, rayon's global pool included, so one test's work
# waits behind another's and the timing-bound UI tests fail now and then.
windows-command: |
pkgs=(-p filmcraft -p filmcraft-platform -p filmcraft-media -p filmcraft-engine -p filmcraft-gpu -p filmcraft-ui-egui)
cargo clippy "${pkgs[@]}" --all-targets --locked --keep-going -- -D warnings
cargo nextest run "${pkgs[@]}" --locked --lib --bins --tests --no-fail-fast