Files
craft-libs/.github/workflows/workspace.yml
T
aiongg ff502fb75f ci: run a fraction of the fuzz-style tests on pull requests, all of them nightly
craft-testkit's hostile hammer reads CRAFT_HOSTILE_DIVISOR=N: the unmodified
seed, every N-th truncation and 1/N of the rounds. hostile::divisor() gives the
same value to sweeps written without the hammer; craft-image-codecs' TIFF zoo
and malformed-header sweeps use it, with a different offset per input so the
inputs together still reach every position. Proptests without their own case
count read proptest's PROPTEST_CASES.

The Workspace gate and the media, audio, video and PDF workflows set
CRAFT_HOSTILE_DIVISOR=8 and PROPTEST_CASES=64. The longest of these tests
(craft-media's MXF hostile input, 1,310 s on Windows; craft-pdf's crypt
proptests, up to 257 s; the image-codecs sweeps, 140-162 s) drop to about an
eighth or a quarter. nightly.yml runs the whole workspace on Linux without
either variable, so every case still runs once a day.

The gate's test-input setup moves to scripts/ci-test-inputs.sh, shared by both
workflows; it uses a corpus that is already present.
2026-11-17 19:09:17 +00:00

97 lines
4.0 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
# Linux and Windows use nextest with explicit doctests (.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
# The fuzz-style tests run a fraction of their cases here: every hostile-input hammer and
# sweep 1/8 (craft-testkit's CRAFT_HOSTILE_DIVISOR), every proptest without its own case
# count 64 cases instead of 256. nightly.yml runs them all in full.
env: |
CRAFT_PRINT_REQUIRE_QUEUE=0
CRAFT_HOSTILE_DIVISOR=8
PROPTEST_CASES=64
setup-command: bash scripts/ci-test-inputs.sh
command: |
python3 scripts/test-workspace-concurrency.py
python3 scripts/test-workspace-tests.py
cargo fmt --check
cargo clippy --workspace --all-targets --locked -- -D warnings
cargo clippy --workspace --all-targets --all-features --locked -- -D warnings
if [ "$RUNNER_OS" = Linux ]; then
# Keep example compilation as well as test=true example tests selected by nextest.
cargo build --workspace --examples --locked
cargo nextest run --workspace --locked --profile ci-linux
cargo test --workspace --doc --locked
cargo build --workspace --examples --all-features --locked
cargo nextest run --workspace --all-features --locked --profile ci-linux
cargo test --workspace --doc --all-features --locked
else
cargo test --workspace --locked
cargo test --workspace --all-features --locked
fi
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