kunobi-daemon 0.5.2

Process ownership, request draining, and verified upgrades for local daemons
Documentation
name: CI

on:
  pull_request:
  push:
    branches: [main]

permissions:
  contents: read

concurrency:
  group: ci-${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

jobs:
  test:
    name: Test (${{ matrix.os }})
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]
    runs-on: ${{ matrix.os }}
    timeout-minutes: 10
    steps:
      - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
      - run: rustup toolchain install 1.95.0 --profile minimal --component rustfmt --component clippy
      - run: cargo fmt --check
      - run: cargo clippy --locked --all-features --all-targets -- -D warnings
      # A link to a module or item that exists only on one platform or behind a
      # feature breaks the docs everywhere else, docs.rs (Linux) included.
      - run: cargo doc --locked --all-features --no-deps
        env:
          RUSTDOCFLAGS: -D warnings
      - run: cargo doc --locked --no-default-features --no-deps
        env:
          RUSTDOCFLAGS: -D warnings
      - run: cargo test --locked --all-features
      - run: cargo test --locked --no-default-features --features wire,local
      - run: cargo test --locked --no-default-features --features wire,local,launch
      - run: cargo test --locked --no-default-features --features wire
      - run: cargo test --locked --no-default-features
      - run: cargo run --locked --no-default-features --features wire --example application_messages
      - run: cargo package --locked

  protobuf:
    name: Protobuf schema
    runs-on: ubuntu-latest
    timeout-minutes: 10
    steps:
      - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
      - run: rustup toolchain install 1.95.0 --profile minimal --component rustfmt --component clippy
      - run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
      - run: cargo fmt --manifest-path tools/proto-gen/Cargo.toml --check
      - run: cargo clippy --locked --manifest-path tools/proto-gen/Cargo.toml -- -D warnings
      - run: cargo run --locked --manifest-path tools/proto-gen/Cargo.toml -- --check
      - run: python3 scripts/check-protobuf.py

  msrv:
    name: Rust 1.89
    runs-on: ubuntu-latest
    timeout-minutes: 10
    steps:
      - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
      - run: rustup toolchain install 1.89.0 --profile minimal
      - run: cargo +1.89.0 test --locked --all-features
      - run: cargo +1.89.0 test --locked --no-default-features --features wire
      - run: cargo +1.89.0 test --locked --no-default-features

  # Native windows-latest cannot see mixed-case .lib names. cargo check does
  # not link; this job is the cargo-xwin path Kunobi's sidecar uses.
  xwin:
    name: Windows cross-link (xwin)
    runs-on: ubuntu-latest
    timeout-minutes: 20
    steps:
      - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
      - run: rustup toolchain install 1.95.0 --profile minimal
      - run: rustup target add x86_64-pc-windows-msvc
      - run: sudo apt-get update && sudo apt-get install -y clang lld
      - run: cargo install cargo-xwin --locked --version 0.23.1
      - run: cargo xwin build --locked --all-features --all-targets --target x86_64-pc-windows-msvc

  # Model-checks the replacement state machine and wire negotiation for every
  # input, not only the cases a test was written for. Same verifier as kache.
  kani:
    name: Kani proofs
    runs-on: ubuntu-latest
    timeout-minutes: 30
    steps:
      - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
      - run: |
          cargo install --locked kani-verifier --version 0.67.0
          cargo kani setup
      # A harness that stops compiling under cfg(kani) would otherwise leave
      # this job green with nothing verified.
      - name: Require at least one harness
        run: |
          cargo kani --all-features list --format json
          count="$(python3 -c 'import json; print(json.load(open("kani-list.json"))["totals"]["standard-harnesses"])')"
          echo "harnesses: $count"
          test "$count" -ge 1
      # All features: the wire harnesses sit behind the `wire` feature.
      - run: cargo kani --all-features --output-format terse

  # Explores every interleaving of WriterSlot's Mutex/Condvar state machine.
  # Default features stay off because Tokio reacts to cfg(loom) internally.
  loom:
    name: Loom (WriterSlot)
    runs-on: ubuntu-latest
    timeout-minutes: 15
    steps:
      - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
      - run: rustup toolchain install 1.95.0 --profile minimal
      - run: cargo test --release --locked --no-default-features --test loom_writer_slot
        env:
          RUSTFLAGS: --cfg loom

  # RustSec advisories, yanked versions, the licence allow-list and allowed
  # sources, per deny.toml. Same policy as kache.
  deny:
    name: cargo-deny
    runs-on: ubuntu-latest
    timeout-minutes: 10
    steps:
      - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
      - uses: EmbarkStudios/cargo-deny-action@3c6349835b2b7b196a839186cb8b78e02f7b5f25 # v2.1.1
        with:
          command: check