mirror of
https://github.com/storytold/lightcraft.git
synced 2026-11-13 17:31:09 -06:00
CI: Windows leg for pull requests that change Windows code, or labelled full-ci (#3793)
* CI: Windows leg for pull requests that change Windows code, or labelled full-ci * ci-windows: also run on manifest and Cargo.lock changes * deps: craft-update with flate2's miniz backend (fixes larger-than-raw ZIP TIFFs on Windows) craft-update's zip dependency used the `deflate` feature, which pulls in flate2's zlib-rs backend. Cargo unifies flate2's features across the app, so on Windows the whole of Lightcraft used zlib-rs, whose level 1 (the TIFF exporter's DeflateLevel::Fast) is a static-Huffman mode that can make a 16-bit ZIP TIFF larger than the uncompressed one. storytold/craft-libs#608 switches craft-update to `deflate-flate2` (miniz_oxide), the backend Linux and macOS already use. Only craft-update's rev moves (c5a1cbf -> a231e51); the other craft-libs crates stay where they are. * ci-windows: cover lightcraft-cli and menus/files.rs (cfg(windows) code)
This commit is contained in:
@@ -0,0 +1,78 @@
|
||||
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.
|
||||
#
|
||||
# Not the full `cargo xtask ci`: on a cold windows-latest runner that is well over an hour, and
|
||||
# its wasm, layers, assets and parity steps don't differ by platform. What does is the
|
||||
# `cfg(windows)` code (title bar theme, monitor profiles, file handling) and its tests.
|
||||
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, and what decides how they build: their
|
||||
# manifests and the lockfile (a dependency bump can break only Windows).
|
||||
paths: |
|
||||
.github/workflows/ci-windows.yml
|
||||
apps/lightcraft/*
|
||||
apps/lightcraft-cli/src/bench_cull.rs
|
||||
apps/lightcraft-cli/tests/it/cli.rs
|
||||
apps/lightcraft-cli/Cargo.toml
|
||||
crates/wincolor/*
|
||||
crates/ui-egui/src/theme.rs
|
||||
crates/ui-egui/src/panels/left/local.rs
|
||||
crates/ui-egui/src/menus/files.rs
|
||||
crates/ui-egui/src/dialogs/settings/performance.rs
|
||||
crates/catalog/src/safe_file.rs
|
||||
crates/catalog/Cargo.toml
|
||||
crates/engine/src/originals.rs
|
||||
crates/engine/src/import/scan.rs
|
||||
crates/engine/src/walk.rs
|
||||
crates/engine/src/doc_path.rs
|
||||
crates/engine/src/rename/*
|
||||
crates/engine/src/cmd/geocode.rs
|
||||
crates/engine/src/tests/sync.rs
|
||||
crates/engine/src/tests/import.rs
|
||||
crates/engine/Cargo.toml
|
||||
crates/ui-egui/Cargo.toml
|
||||
Cargo.toml
|
||||
Cargo.lock
|
||||
rust-toolchain.toml
|
||||
.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
|
||||
targets: ""
|
||||
tools: ""
|
||||
timeout-minutes: 90
|
||||
windows-command: |
|
||||
pkgs=(-p lightcraft-wincolor -p lightcraft-catalog -p lightcraft-engine -p lightcraft-ui-egui -p lightcraft -p lightcraft-cli)
|
||||
cargo clippy "${pkgs[@]}" --all-targets --keep-going -- -D warnings
|
||||
cargo test "${pkgs[@]}" --lib --bins --tests --no-fail-fast
|
||||
Reference in New Issue
Block a user