compio-pool 0.1.0

A bb8-style connection pool for compio: build once, clone the handle onto each thread-per-core io_uring runtime, and lease ring-local connections that never cross threads
Documentation
name: CI

on:
  push:
  pull_request:
  workflow_dispatch:

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

# The crate is Linux-only: SO_REUSEPORT load balancing, io_uring and the IRQ
# affinity recipe are all Linux semantics. Every job here runs on Ubuntu.
env:
  CARGO_TERM_COLOR: always

jobs:
  fmt:
    name: Rustfmt
    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 --all-targets --locked -- -D warnings

  test:
    name: Test (${{ matrix.toolchain }})
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        toolchain: [stable, beta]
    env:
      # Stable has to stay warning-clean; beta is early warning for test
      # failures, not for a lint that does not exist on stable yet.
      RUSTFLAGS: ${{ matrix.toolchain == 'stable' && '-D warnings' || '' }}
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@master
        with:
          toolchain: ${{ matrix.toolchain }}
      - uses: Swatinem/rust-cache@v2
      - name: Build (all targets, incl. examples)
        run: cargo build --all-targets --locked
      # The integration tests bind SO_REUSEPORT listeners on 127.0.0.1 and
      # drive them through io_uring, which the hosted runners' kernels allow.
      - name: Test
        run: cargo test --all-targets --locked
      - name: Doc tests
        run: cargo test --doc --locked

  msrv:
    name: MSRV (1.95)
    runs-on: ubuntu-latest
    env:
      RUSTFLAGS: -D warnings
    steps:
      - uses: actions/checkout@v4
      # Keep in step with `rust-version` in Cargo.toml and the note in README.md.
      # 1.95 is where `cfg_select!`, used by compio's executor, became stable.
      - uses: dtolnay/rust-toolchain@1.95.0
      - uses: Swatinem/rust-cache@v2
      # `--lib` only: dev-dependencies do not bind downstream users.
      - run: cargo build --lib --locked

  docs:
    name: Docs
    runs-on: ubuntu-latest
    env:
      RUSTDOCFLAGS: -D warnings --cfg docsrs
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@nightly
      - uses: Swatinem/rust-cache@v2
      - run: cargo doc --no-deps --locked

  shell:
    name: Tuning script parses and passes shellcheck
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: sudo apt-get update && sudo apt-get install -y --no-install-recommends shellcheck ethtool
      - run: bash -n scripts/tune-nic.sh
      - run: shellcheck scripts/tune-nic.sh
      - run: scripts/tune-nic.sh --self-test
      # `--check` is read-only. It reports the runner NIC's capability and
      # exits 0 or 2; either proves the script runs end to end.
      - run: scripts/tune-nic.sh --check || test $? -eq 2

  links:
    name: Doc cross-links resolve
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      # README and docs/ link into each other heavily; a renamed file is
      # otherwise invisible until a reader hits the 404. `--offline` checks
      # relative paths only, so this never fails on a flaky external host.
      - uses: lycheeverse/lychee-action@v2
        with:
          args: --offline --no-progress --verbose "**/*.md"
          fail: true