fabro/.github/workflows/rust.yml
Bryan Helmkamp 7bde4e9e10 Configure nextest slow-timeout profiles for unit vs e2e tests
Tighten default profile to 2s slow / 4s kill for fast feedback on
hanging unit tests, and add an `e2e` profile with 10s slow / 30s kill
for ignored tests that hit real APIs. Switch CLAUDE.md/AGENTS.md and
CI to use `cargo nextest run`. Fix retry_emits_stage_started_per_attempt
test that exceeded the new timeout by using aggressive backoff preset
instead of the 5s default.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 15:47:20 -04:00

85 lines
2.3 KiB
YAML

name: Rust
on:
push:
branches: [main]
paths:
- "lib/crates/**"
- "Cargo.toml"
- "Cargo.lock"
- ".cargo/**"
- "openapi/**"
- ".github/workflows/rust.yml"
pull_request:
branches: [main]
paths:
- "lib/crates/**"
- "Cargo.toml"
- "Cargo.lock"
- ".cargo/**"
- "openapi/**"
- ".github/workflows/rust.yml"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
jobs:
fmt:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable
- run: cargo fmt --check --all
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable
- uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2
with:
cache-on-failure: true
- run: cargo clippy --workspace -- -D warnings
test:
name: Test (Linux)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable
- uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2
with:
cache-on-failure: true
- uses: taiki-e/install-action@nextest
- run: cargo nextest run --workspace
test-macos:
name: Test (macOS)
if: github.event_name == 'workflow_dispatch'
runs-on: macos-15
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable
- uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2
with:
cache-on-failure: true
- uses: taiki-e/install-action@nextest
- run: cargo nextest run --workspace