siggy 1.8.0

Terminal-based Signal messenger client with vim keybindings
Documentation
name: CI

on:
  push:
    branches: ["**"]
  pull_request:
    branches: [master]

jobs:
  lint:
    name: Lint
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6

      - uses: dtolnay/rust-toolchain@stable

      - uses: Swatinem/rust-cache@v2

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

      - name: Clippy
        run: cargo clippy --tests -- -D warnings

      - name: App field-count ratchet
        run: bash scripts/check-app-field-count.sh

  test:
    name: Test (${{ matrix.os }})
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]
    steps:
      - uses: actions/checkout@v6

      - uses: dtolnay/rust-toolchain@stable

      - uses: Swatinem/rust-cache@v2

      - name: Test
        run: cargo test

  fuzz:
    name: Fuzz (${{ matrix.target }})
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        target: [fuzz_command_parse, fuzz_input_edit, fuzz_json_rpc, fuzz_key_combo]
    env:
      # cargo-fuzz needs nightly. RUSTUP_TOOLCHAIN overrides
      # rust-toolchain.toml's stable pin for this job only.
      RUSTUP_TOOLCHAIN: nightly
    steps:
      - uses: actions/checkout@v6

      - uses: dtolnay/rust-toolchain@nightly

      - uses: Swatinem/rust-cache@v2
        with:
          workspaces: fuzz

      - name: Install cargo-fuzz
        # Intentionally not --locked: cargo-fuzz's bundled lockfile pins
        # rustix v0.36.5, which uses unstable `rustc_attrs` no longer
        # accepted by current nightly. Resolving fresh transitive deps
        # picks a rustix that compiles.
        run: cargo install cargo-fuzz

      - name: Run ${{ matrix.target }}
        run: cargo fuzz run ${{ matrix.target }} -- -max_total_time=60