clark-agent 0.4.0

Typed agent loop with typed messages, typed events, swappable LLM transport, and plugin hooks. Provider-agnostic, sandbox-agnostic, tooling-agnostic. By Clark Labs Inc.
Documentation
name: CI

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

permissions:
  contents: read

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

env:
  CARGO_TERM_COLOR: always
  RUSTFLAGS: -D warnings

jobs:
  check:
    name: fmt · clippy · test · doc
    runs-on: ubuntu-24.04
    timeout-minutes: 30
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

      - name: Install stable toolchain
        uses: dtolnay/rust-toolchain@4cda84d5c5c54efe2404f9d843567869ab1699d4
        with:
          toolchain: 1.97.1
          components: rustfmt, clippy

      - name: Cache cargo
        uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
        with:
          cache-targets: false

      - name: Set up pinned kache
        uses: kunobi-ninja/kache-action@49398d37113c616fdb61be434cb497e3c2c8f3e6 # v1
        with:
          version: 0.14.2
          cache-key-prefix: clark-agent-check

      - name: Restore pinned cargo-nextest
        id: nextest-cache
        uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
        with:
          path: ~/.cargo/bin/cargo-nextest
          key: cargo-nextest-${{ runner.os }}-${{ runner.arch }}-0.9.143

      - name: Install pinned cargo-nextest
        if: steps.nextest-cache.outputs.cache-hit != 'true'
        run: cargo install cargo-nextest --version 0.9.143 --locked

      - name: Cache pinned cargo-nextest
        if: steps.nextest-cache.outputs.cache-hit != 'true'
        uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
        with:
          path: ~/.cargo/bin/cargo-nextest
          key: cargo-nextest-${{ runner.os }}-${{ runner.arch }}-0.9.143

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

      - name: Clippy
        run: cargo clippy --all-targets -- -D warnings

      - name: Test
        run: cargo nextest run --all-targets

      - name: Doc tests
        run: cargo test --doc

      - name: Docs (deny warnings)
        env:
          RUSTDOCFLAGS: -D warnings
        run: cargo doc --no-deps

  msrv:
    name: MSRV (1.94)
    runs-on: ubuntu-24.04
    timeout-minutes: 20
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

      - name: Install MSRV toolchain
        uses: dtolnay/rust-toolchain@4cda84d5c5c54efe2404f9d843567869ab1699d4
        with:
          toolchain: "1.94"

      - name: Cache cargo
        uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
        with:
          cache-targets: false

      - name: Set up pinned kache
        uses: kunobi-ninja/kache-action@49398d37113c616fdb61be434cb497e3c2c8f3e6 # v1
        with:
          version: 0.14.2
          cache-key-prefix: clark-agent-msrv

      - name: Build on MSRV
        run: cargo build --all-targets

  publish-dry-run:
    name: publish --dry-run
    runs-on: ubuntu-24.04
    timeout-minutes: 20
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

      - name: Install stable toolchain
        uses: dtolnay/rust-toolchain@4cda84d5c5c54efe2404f9d843567869ab1699d4
        with:
          toolchain: 1.97.1

      - name: Cache cargo
        uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
        with:
          cache-targets: false

      - name: Set up pinned kache
        uses: kunobi-ninja/kache-action@49398d37113c616fdb61be434cb497e3c2c8f3e6 # v1
        with:
          version: 0.14.2
          cache-key-prefix: clark-agent-publish

      - name: Package check
        run: cargo publish --dry-run