ci(test-crates): align workflow with release CI conventions
Match naming, permissions, concurrency, mold linker, and cache save-if policy (write only from pre-release) used by the Slint release jobs.
This commit is contained in:
2 files changed
+50
-21
No files matched your search
@@ -1,18 +1,30 @@
|
||||
name: Test crates
|
||||
# Workspace unit/doc tests for the shipping crates/ tree (Slint-era).
|
||||
#
|
||||
# Companion to the release/build workflows, not a substitute:
|
||||
# - release-linux / build-slint / release-snap compile -p qbz (full UI, ~30 GB peak)
|
||||
# - this job runs `cargo test` on every non-UI crate only (~5 min cold, ~1–2 min warm)
|
||||
#
|
||||
# Excludes qbz, qbz-ui, qbz-dac-wizard, qbz-slint-common so the UI compile unit
|
||||
# never enters the graph. Cache key is intentionally separate from
|
||||
# `slint-linux` (stable + test profile vs nightly + release).
|
||||
#
|
||||
# Repo policy note: release builds stay tag/dispatch-only. This is the one
|
||||
# workflow that runs on pre-release integration so regressions land before a
|
||||
# release cut. Path-filtered so packaging/docs PRs skip it.
|
||||
|
||||
# Unit/doc tests for the shipping Rust workspace (no Slint UI graph).
|
||||
# Intentionally excludes qbz / qbz-ui / qbz-dac-wizard / qbz-slint-common so
|
||||
# CI never hits the 20–30 GB UI compile wall. Warm runs are a few seconds;
|
||||
# cold first run is dominated by dependency compile + rust-cache restore.
|
||||
name: test-crates
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
# pre-release is the real base; main is listed so a PR opened against main
|
||||
# still runs once before redirect-pr-to-prerelease retargets it.
|
||||
branches: [pre-release, main]
|
||||
paths:
|
||||
- "crates/**"
|
||||
- "scripts/cargo-test.sh"
|
||||
- ".github/workflows/test-crates.yml"
|
||||
push:
|
||||
# Integration branch only — never main (a push to main is a release merge).
|
||||
branches: [pre-release]
|
||||
paths:
|
||||
- "crates/**"
|
||||
@@ -21,44 +33,60 @@ on:
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: test-crates-${{ github.workflow }}-${{ github.ref }}
|
||||
group: test-crates-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: cargo test (workspace, no UI)
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 45
|
||||
# Cold first run ~5 min (compile + test); warm ~1–2 min. Headroom for
|
||||
# registry lag / cache restore, not for a Slint UI compile.
|
||||
timeout-minutes: 20
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: System dependencies
|
||||
- name: Install system dependencies
|
||||
run: |
|
||||
# Non-UI crates still link Linux audio / D-Bus stubs (qbz-audio).
|
||||
# Minimal subset of release-linux.yml deps: non-UI crates still link
|
||||
# ALSA / JACK / D-Bus (qbz-audio) and OpenSSL (reqwest). mold matches
|
||||
# the release linker for faster test-binary link.
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y --no-install-recommends \
|
||||
build-essential pkg-config \
|
||||
build-essential pkg-config mold \
|
||||
libasound2-dev libjack-jackd2-dev \
|
||||
libdbus-1-dev libssl-dev
|
||||
|
||||
- name: Rust toolchain
|
||||
# Floating stable is fine here: rust-cache keys on rustc -V, so a stable
|
||||
# bump just rebuilds the test cache once. Nightly is reserved for the
|
||||
# release/UI builds that need -Z threads.
|
||||
- name: Setup Rust
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
|
||||
- name: Cargo cache
|
||||
- name: Rust cache
|
||||
uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
# Manifest is crates/Cargo.toml → artifacts in crates/target (same
|
||||
# workspaces mapping as release-linux / build-slint).
|
||||
workspaces: crates -> target
|
||||
shared-key: test-crates-linux
|
||||
cache-on-failure: true
|
||||
# PRs restore only. pre-release pushes write so the integration
|
||||
# branch keeps the cache warm (mirrors release-linux save-if policy).
|
||||
save-if: ${{ github.ref == 'refs/heads/pre-release' }}
|
||||
|
||||
- name: cargo test
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
CARGO_BUILD_JOBS: "2"
|
||||
# Keyring / credentials tests skip themselves when CI=true.
|
||||
CI: "true"
|
||||
# Faster link; no -Z flags (stable toolchain).
|
||||
RUSTFLAGS: "-C link-arg=-fuse-ld=mold"
|
||||
run: |
|
||||
echo "::group::rustc / cargo"
|
||||
echo "::group::toolchain"
|
||||
rustc -V
|
||||
cargo -V
|
||||
echo "::endgroup::"
|
||||
|
||||
Reference in new issue
Block a user