kinjo 0.1.5

Kinjo: mDNS TUI and commands launch for local network services
Documentation
name: Check and Build Rust project

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

permissions:
  contents: read

# Cancel superseded runs when a branch is pushed again.
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

env:
  CARGO_TERM_COLOR: always

jobs:
  format:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v7
    - name: Check formatting
      run: cargo fmt -- --check

  clippy:
    name: Clippy on ${{ matrix.os }}
    runs-on: ${{ matrix.os }}

    strategy:
      matrix:
        # Lint on every target OS so cfg-gated code paths (e.g. the
        # windows/unix branches in plumber::exec) are not lint-blind.
        os: [ubuntu-latest, windows-latest, macos-latest]

    steps:
    - uses: actions/checkout@v7
    - name: Set up build environment
      uses: ./.github/actions/setup
    - name: Run clippy
      run: cargo clippy --locked --all-targets -- -D warnings
    # The zeroconf backend is feature-gated and needs the Avahi client
    # headers, which only the Linux runner installs.
    - name: Run clippy (all features)
      if: matrix.os == 'ubuntu-latest'
      run: cargo clippy --locked --all-targets --all-features -- -D warnings

  build:
    name: Build on ${{ matrix.os }}
    runs-on: ${{ matrix.os }}

    strategy:
      matrix:
        # Defines the target operating systems
        os: [ubuntu-latest, windows-latest, macos-latest]

    steps:
    - uses: actions/checkout@v7

    - name: Set up build environment
      uses: ./.github/actions/setup

    # `cargo test` builds every target it needs, so a separate build step
    # would only duplicate work.
    - name: Run tests
      run: cargo test --locked

    # The zeroconf backend is feature-gated and needs the Avahi client
    # headers, which only the Linux runner installs.
    - name: Run tests (all features)
      if: matrix.os == 'ubuntu-latest'
      run: cargo test --locked --all-features