Files
Jason b544bc27c6 ci: run backend tests under cargo-nextest and cache deps with rust-cache
- Backend tests run with `cargo nextest run --profile ci`: one process
  per test, a 180s per-test timeout (src-tauri/.config/nextest.toml),
  and no fail-fast. The WSL2 nightly uses it too, still one test at a
  time and with the same selection as the old `--skip database::`, so a
  hung test is killed instead of eating the whole job.
- Integration tests shared one fixed test home, and each process wiped
  it on startup. Under nextest they ran concurrently and failed en
  masse, so tests/support.rs now picks a directory per
  NEXTEST_TEST_GLOBAL_SLOT. Plain `cargo test` keeps the old directory.
- Swatinem/rust-cache replaces the hand-rolled actions/cache step. It
  caches dependencies only, not the cc-switch crate that is rebuilt
  every run, and keys on OS, rustc version and Cargo.lock. The WSL2 CI
  job and the nightly share the `backend` key but only restore it, so
  their lib-only builds never save over the full Windows cache.
- Quote the $GITHUB_OUTPUT redirect that shellcheck flagged.
2026-10-05 12:17:50 +08:00

11 lines
427 B
TOML

# CI 用 cargo-nextest 跑后端测试:每个测试一个进程,单个测试卡住时按下面的超时终止,
# 不会拖到整个 job 超时。本地照常用 `cargo test` 也行。
[profile.default]
# 每 60 秒报一次“慢”,第 3 个周期(180 秒)还没结束就终止这个测试
slow-timeout = { period = "60s", terminate-after = 3 }
[profile.ci]
# 跑完全部测试再汇总失败
fail-fast = false