name: Maintenance

on:
  schedule:
    - cron: "0 8 * * 1"
  workflow_dispatch:

env:
  CARGO_TERM_COLOR: always

permissions:
  contents: read

jobs:
  # Weekly dependency policy drift check.
  dependency-policy:
    name: Dependency Policy (cargo-deny)
    runs-on: ubuntu-latest
    timeout-minutes: 20
    steps:
      - uses: actions/checkout@v6
      - uses: actions-rust-lang/setup-rust-toolchain@v1
      - uses: Swatinem/rust-cache@v2
      - name: Install cargo-deny
        run: cargo install --locked cargo-deny
      - name: Check advisories, bans, licenses, and sources
        run: cargo deny check all

  # Weekly toolchain drift check against latest stable.
  latest-stable-smoke:
    name: Latest Stable Smoke
    runs-on: ubuntu-latest
    timeout-minutes: 30
    steps:
      - uses: actions/checkout@v6
      - uses: actions-rust-lang/setup-rust-toolchain@v1
      - uses: Swatinem/rust-cache@v2
      - name: Build and test workspace
        run: cargo test --workspace --all-features --all-targets
