drep-ai 2.7.2

A local commit gate: runs the linters your repo configures, and sends changed code to an LLM for review
Documentation
name: rust

on:
  push:
    branches: [main]
  pull_request:

env:
  CARGO_TERM_COLOR: always

permissions:
  contents: read

jobs:
  # homelab-1 has one repository-scoped runner, so separate Linux jobs would only
  # serialize while repeating checkout, cache and toolchain setup. Keep the
  # complete Linux gate in one allocation; macOS remains independent below.
  linux:
    name: validate (homelab-1)
    if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository
    runs-on: [self-hosted, linux, x64, drep-linux]
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

      - uses: dtolnay/rust-toolchain@4360b52568e2003a75bf9bc1d59f33a8e3fc893c # stable
        with:
          toolchain: stable
          components: rustfmt, clippy

      - uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
        with:
          # Its default save cleanup deletes every Cargo binary present when
          # the action starts. These runners own pinned publisher tools.
          cache-bin: false

      - name: Format
        run: cargo fmt --all --check

      # Lint levels come from [lints] in Cargo.toml, not from flags here.
      - name: Clippy
        run: cargo clippy --all-targets --all-features

      - name: Test
        run: cargo test --all-targets --all-features

      # If this breaks, the MSRV in Cargo.toml is wrong - do not paper over it
      # by bumping the toolchain here. It has moved once already: `ignore`
      # 0.4.30 raised the real floor to 1.88 while open-agent-sdk still asks
      # for 1.85, and declares no `rust-version`, so the first sign was a
      # compile error in a dependency.
      - uses: dtolnay/rust-toolchain@4360b52568e2003a75bf9bc1d59f33a8e3fc893c # stable
        with:
          toolchain: 1.88.0

      # No --all-targets: MSRV is a property of [dependencies]. Whether the dev
      # dependencies build on 1.88 has no consumer.
      - name: MSRV
        run: cargo +1.88.0 check

  test-macos:
    name: test (Mac mini)
    if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository
    runs-on: [self-hosted, macos, arm64, drep-macos]
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

      - uses: dtolnay/rust-toolchain@4360b52568e2003a75bf9bc1d59f33a8e3fc893c # stable
        with:
          toolchain: stable
          components: clippy

      - uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
        with:
          cache-bin: false

      - run: cargo test --all-targets --all-features