mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-17 18:04:48 +00:00
* ci: run the Windows gate's tests with nextest and link with rust-lld The Windows leg of the Workspace gate takes 55-100 minutes. About half of that is cargo test running ~370 test binaries one after another, twice (default and all features), and another 15-17 minutes per feature set is the uncached test build, where link.exe links every test executable. - Windows runs the tests with cargo-nextest (parallel across binaries) and the doctests with cargo test --doc. The same tests run; .config/nextest.toml puts the tests that relied on in-process mutexes (craft-ui GPU, craft-video h264 fixtures, craft-print) in one-at-a-time groups. - Windows links with rust-lld via CARGO_TARGET_X86_64_PC_WINDOWS_MSVC_LINKER. Linux and macOS legs are unchanged. * ci: keep link.exe on the Windows gate The first run with rust-lld built the tests no faster than link.exe at the same runner speed (14.4 min against 15.1 min on a runner 8% slower at clippy), so the linker change is not worth its risk. nextest stays.
94 lines
3.9 KiB
YAML
94 lines
3.9 KiB
YAML
name: Workspace
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
tags: ["v*"]
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
# Pull requests share one group per branch, so a newer push cancels the older run. Every other
|
|
# run (push to main, a release tag, a manual run) gets a group of its own: it is neither
|
|
# cancelled nor replaced while queued, so a main run always finishes and saves the dependency
|
|
# cache, and a release run is never cancelled.
|
|
group: workspace-${{ github.event_name == 'pull_request' && github.ref || github.run_id }}
|
|
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
|
|
|
jobs:
|
|
native:
|
|
name: Workspace
|
|
uses: storytold/craft-common-actions/.github/workflows/gate.yml@main
|
|
with:
|
|
os: '["ubuntu-latest","windows-latest","macos-latest"]'
|
|
timeout-minutes: 120
|
|
# The Windows leg runs its tests with nextest (.config/nextest.toml).
|
|
tools: cargo-nextest@0.9.150
|
|
packages: mesa-vulkan-drivers libvulkan1
|
|
craft-fonts-ref: b076417b5880bd4154bd22f00695b1d28c6bea83
|
|
linux-env: WGPU_BACKEND=vulkan
|
|
windows-env: CRAFT_PRINT_REQUIRE_QUEUE=1
|
|
env: CRAFT_PRINT_REQUIRE_QUEUE=0
|
|
setup-command: |
|
|
set -euo pipefail
|
|
corpus_fetcher=.test-inputs/photocraft
|
|
mkdir -p "$corpus_fetcher"
|
|
git -C "$corpus_fetcher" init
|
|
git -C "$corpus_fetcher" remote add origin https://github.com/storytold/PhotoCraft.git
|
|
git -C "$corpus_fetcher" fetch --quiet --depth=1 origin 74330157cb601573ae4523a95bb9132822fc3918
|
|
git -C "$corpus_fetcher" checkout --quiet --detach FETCH_HEAD
|
|
(cd "$corpus_fetcher" && cargo xtask corpus --psd --psd-tools --atn --exr --heif --pngsuite)
|
|
mkdir -p corpus
|
|
cp -a "$corpus_fetcher/corpus/." corpus/
|
|
python scripts/test-fetch-pdf-test-fonts.py
|
|
python scripts/fetch-pdf-test-fonts.py "$RUNNER_TEMP/craft-pdf-test-fonts"
|
|
printf 'CRAFT_PSD_CORPUS=%s\n' "$GITHUB_WORKSPACE/$corpus_fetcher/corpus" >> "$GITHUB_ENV"
|
|
printf 'CRAFT_PDF_TEST_FONT_DIR=%s\n' "$RUNNER_TEMP/craft-pdf-test-fonts" >> "$GITHUB_ENV"
|
|
command: |
|
|
python3 scripts/test-workspace-concurrency.py
|
|
cargo fmt --check
|
|
cargo clippy --workspace --all-targets --locked -- -D warnings
|
|
cargo clippy --workspace --all-targets --all-features --locked -- -D warnings
|
|
cargo test --workspace --locked
|
|
cargo test --workspace --all-features --locked
|
|
windows-command: |
|
|
powershell.exe -NoProfile -Command '$ErrorActionPreference = "Stop"; Start-Service Spooler; Add-PrinterDriver -Name "Generic / Text Only"'
|
|
cargo fmt --check
|
|
cargo clippy --workspace --all-targets --locked -- -D warnings
|
|
cargo clippy --workspace --all-targets --all-features --locked -- -D warnings
|
|
# The same tests as `cargo test`, run in parallel across test binaries instead of one
|
|
# binary at a time; nextest skips doctests, so `cargo test --doc` runs them.
|
|
cargo nextest run --workspace --locked --profile ci
|
|
cargo test --workspace --doc --locked
|
|
cargo nextest run --workspace --all-features --locked --profile ci
|
|
cargo test --workspace --doc --all-features --locked
|
|
|
|
msrv:
|
|
name: Rust 1.95
|
|
uses: storytold/craft-common-actions/.github/workflows/gate.yml@main
|
|
with:
|
|
os: '["ubuntu-latest"]'
|
|
toolchain: 1.95.0
|
|
targets: ""
|
|
tools: ""
|
|
craft-fonts-ref: ""
|
|
require-craft-fonts: false
|
|
timeout-minutes: 15
|
|
dev-debug: ""
|
|
command: cargo check --workspace --lib --all-features --locked
|
|
|
|
wasm:
|
|
name: UI and settings WASM
|
|
uses: storytold/craft-common-actions/.github/workflows/gate.yml@main
|
|
with:
|
|
os: '["ubuntu-latest"]'
|
|
targets: wasm32-unknown-unknown
|
|
tools: ""
|
|
craft-fonts-ref: ""
|
|
require-craft-fonts: false
|
|
timeout-minutes: 15
|
|
command: cargo check -p craft-ui -p craft-settings --all-features --locked --target wasm32-unknown-unknown
|