rash-ssh 0.1.1

Rust Auto SSH — start an ssh session or tunnel, monitor it, and restart it when it dies or stops passing traffic
Documentation
name: CI

on:
  push:
    branches: [main]
  pull_request:
  # So release.yml can gate a release on this exact matrix rather than
  # restating a copy of it that would drift.
  workflow_call:

env:
  CARGO_TERM_COLOR: always
  # So a panicking test says where, rather than just exiting 101.
  RUST_BACKTRACE: 1

jobs:
  fmt:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      # Stable, not nightly: rustfmt.toml sets only `edition`, which stable has
      # handled since 1.85. Formatting on nightly means an unrelated nightly
      # can turn CI red on code nobody touched.
      - uses: dtolnay/rust-toolchain@master
        with:
          toolchain: stable
          components: rustfmt
      - run: cargo fmt --all -- --check

  test:
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, macos-latest]
        # The MSRV is in the matrix so `rust-version` in Cargo.toml stays a
        # fact rather than an aspiration.
        toolchain: [stable, nightly, "1.88"]
    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@master
        with:
          toolchain: ${{ matrix.toolchain }}
          components: clippy
      - uses: Swatinem/rust-cache@v2
      # -D warnings belongs here, after the --, so it applies to this crate
      # only. As a global RUSTFLAGS it would also deny warnings in every
      # dependency, and a new lint in a newer compiler would then fail the
      # build for code that is not ours.
      #
      # Clippy is skipped on the MSRV row: its lints move with the compiler, so
      # pinning an old one only tests which lints existed in 1.88.
      - run: cargo clippy --all-targets --all-features -- -D warnings
        if: matrix.toolchain != '1.88'
      # --all-features is what builds fake-ssh. Without it tests/e2e.rs cfgs
      # itself out and the end-to-end suite reports zero tests, in green.
      - run: cargo test --all-features --all-targets
      # --all-targets silently excludes doctests, so they need their own run.
      - run: cargo test --doc