muxtop 0.5.1

A modern, multiplexed system monitor for the terminal
name: CI

on:
  push:
    branches: [develop, main]
  pull_request:
    # `main` is required here, not just `develop`. The branch protection on
    # `main` requires all six checks below to pass on the release PR, but a
    # `pull_request` trigger scoped to `develop` alone never produces them on
    # a develop -> main PR — deadlocking every release behind checks that
    # could not run. See PR #18.
    branches: [develop, main]

env:
  CARGO_TERM_COLOR: always
  RUSTFLAGS: -Dwarnings

jobs:
  fmt:
    name: Format
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: rustfmt
      - run: cargo fmt --all -- --check

  clippy:
    name: Clippy
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: clippy
      - uses: Swatinem/rust-cache@v2
      - run: cargo clippy --workspace --all-targets -- -D warnings

  deny:
    name: Cargo Deny
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: EmbarkStudios/cargo-deny-action@v2

  test:
    name: Test (${{ matrix.os }})
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        # Windows is not a release target — `release.yml` publishes musl and
        # darwin binaries only, and the process actions (kill / renice) are
        # POSIX-only stubs there. It is in the matrix purely as a regression
        # guard: an ungated `libc::` call breaks the build for anyone
        # developing on Windows, and that went unnoticed for two releases
        # because nothing here compiled the workspace on it.
        os: [ubuntu-latest, macos-latest, windows-latest]
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
      - uses: Swatinem/rust-cache@v2
      - run: cargo test --workspace

  bench:
    name: Bench compile check
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
      - uses: Swatinem/rust-cache@v2
      - run: cargo bench --workspace --no-run