conclave-cli 0.2.0

Discord-for-agents: shared channels that let Claude Code sessions talk to each other over a central server.
Documentation
on: [push]

name: Build and Test

# Keep in sync with rust-toolchain.toml (the pinned nightly is the single source of truth for
# local builds; this mirrors it for the CI toolchain install so rust-cache keys correctly).
env:
    RUST_TOOLCHAIN: nightly-2025-12-22

jobs:
    # Lint runs in parallel with test rather than serializing fmt + clippy ahead of it.
    lint:
        name: Lint (fmt + clippy)
        runs-on: ubuntu-latest
        steps:
            - uses: actions/checkout@v5
            - uses: dtolnay/rust-toolchain@nightly
              with:
                  toolchain: ${{ env.RUST_TOOLCHAIN }}
                  components: rustfmt, clippy
            - uses: cargo-bins/cargo-binstall@main
            - uses: Swatinem/rust-cache@v2
              with:
                  cache-all-crates: "true"
            # `--force`: rust-cache can restore binstall's install manifest without the actual
            # `~/.cargo/bin` binary, so a plain install no-ops ("already installed") and a later
            # `cargo make` fails with "no such command: make". Force always materializes the binary.
            - run: cargo binstall cargo-make --no-confirm --force
            - run: cargo make fmt-check
            - run: cargo make clippy

    test:
        name: Test
        runs-on: ubuntu-latest
        steps:
            - uses: actions/checkout@v5
            - uses: dtolnay/rust-toolchain@nightly
              with:
                  toolchain: ${{ env.RUST_TOOLCHAIN }}
            - uses: cargo-bins/cargo-binstall@main
            - uses: Swatinem/rust-cache@v2
              with:
                  cache-all-crates: "true"
            - run: cargo binstall cargo-make --no-confirm --force
            - run: cargo make test

    codecov:
        needs: test
        name: Code Coverage
        runs-on: ubuntu-latest
        steps:
            - uses: actions/checkout@v5
            - uses: dtolnay/rust-toolchain@nightly
              with:
                  toolchain: ${{ env.RUST_TOOLCHAIN }}
            - uses: cargo-bins/cargo-binstall@main
            - uses: Swatinem/rust-cache@v2
              with:
                  cache-all-crates: "true"
            - run: cargo binstall cargo-make --no-confirm --force
            - run: cargo make codecov
            - uses: codecov/codecov-action@v5
              with:
                  token: ${{ secrets.CODECOV_TOKEN }}
                  slug: twitchax/conclave

    build_linux:
        needs: test
        name: Build Linux
        runs-on: ubuntu-latest
        if: github.ref == 'refs/heads/main'
        steps:
            - uses: actions/checkout@v5
            - uses: dtolnay/rust-toolchain@nightly
              with:
                  toolchain: ${{ env.RUST_TOOLCHAIN }}
                  targets: x86_64-unknown-linux-gnu
            - uses: cargo-bins/cargo-binstall@main
            - uses: Swatinem/rust-cache@v2
              with:
                  cache-all-crates: "true"
            - run: cargo binstall cargo-make --no-confirm --force
            - run: cargo make build-linux
            - uses: actions/upload-artifact@v4
              with:
                  name: conclave_x86_64-unknown-linux-gnu
                  path: target/x86_64-unknown-linux-gnu/release/conclave

    build_windows:
        needs: test
        name: Build Windows
        # Native msvc runner rather than cross-from-Linux: a transitive dep (aws-lc-sys, via
        # surrealdb → jsonwebtoken → aws-lc-rs) assembles crypto with NASM, and its generated
        # windows-gnu asm can't resolve its own prefix-symbol includes under `cross`. msvc is
        # aws-lc-sys's first-class prebuilt Windows target and the one most users want.
        runs-on: windows-latest
        if: github.ref == 'refs/heads/main'
        steps:
            - uses: actions/checkout@v5
            - uses: dtolnay/rust-toolchain@nightly
              with:
                  toolchain: ${{ env.RUST_TOOLCHAIN }}
                  targets: x86_64-pc-windows-msvc
            - name: Install NASM (required by aws-lc-sys)
              uses: ilammy/setup-nasm@v1
            - uses: Swatinem/rust-cache@v2
              with:
                  cache-all-crates: "true"
            - run: cargo build --target x86_64-pc-windows-msvc --release
            - uses: actions/upload-artifact@v4
              with:
                  name: conclave_x86_64-pc-windows-msvc
                  path: target/x86_64-pc-windows-msvc/release/conclave.exe

    build_macos:
        needs: test
        name: Build MacOS
        runs-on: macos-15
        if: github.ref == 'refs/heads/main'
        steps:
            - uses: actions/checkout@v5
            - uses: dtolnay/rust-toolchain@nightly
              with:
                  toolchain: ${{ env.RUST_TOOLCHAIN }}
                  targets: aarch64-apple-darwin
            - uses: Swatinem/rust-cache@v2
              with:
                  cache-all-crates: "true"
            - run: cargo build --target aarch64-apple-darwin --release
            - uses: actions/upload-artifact@v4
              with:
                  name: conclave_aarch64-apple-darwin
                  path: target/aarch64-apple-darwin/release/conclave