syswatch 0.7.7

Single-host, read-only system diagnostics TUI. Twelve tabs covering CPU, memory, disks, processes, GPU, power, services, network, plus a Timeline scrubber and an Insights anomaly engine. Sibling to netwatch.
name: CI

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

env:
  CARGO_TERM_COLOR: always

jobs:
  test:
    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]
    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
      - uses: Swatinem/rust-cache@v2

      - name: Check formatting
        run: cargo fmt --check

      - name: Clippy
        run: cargo clippy -- -W clippy::all

      - name: Build
        run: cargo build --release

      - name: Test
        run: cargo test

  # Nothing built the flake, so it silently rotted: the version was
  # pinned five releases behind and `src` was dragging `target/` into
  # the store. Cheap Linux-only job to keep both honest.
  nix:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: cachix/install-nix-action@v27
        with:
          extra_nix_config: |
            experimental-features = nix-command flakes

      - name: Flake check
        run: nix flake check --all-systems

      - name: Build
        run: nix build .#syswatch --print-build-logs

      - name: Version matches Cargo.toml
        run: |
          cargo_version=$(nix eval --raw --impure --expr \
            '(builtins.fromTOML (builtins.readFile ./Cargo.toml)).package.version')
          built=$(nix eval --raw .#syswatch.version)
          echo "Cargo.toml=$cargo_version  package.nix=$built"
          test "$cargo_version" = "$built"