hpip 0.1.2

Host These Things Please - a modern async HTTP file server
name: ci-linux

permissions:
  contents: read

on:
  pull_request:
    types: [opened, synchronize, reopened]
    paths:
      - "**.rs"
      - "**/Cargo.toml"
      - ".github/workflows/**"
  push:
    branches:
      - main
    paths:
      - "**.rs"
      - "**/Cargo.toml"
      - ".github/workflows/**"

jobs:
  format:
    name: Format
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - uses: dtolnay/rust-toolchain@nightly
        with:
          components: rustfmt
      - name: Check formatting
        run: cargo fmt --all --check

  clippy:
    name: Clippy
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: clippy
      - name: Clippy check
        run: cargo clippy --all-targets -- -D warnings

  test:
    name: Test (stable) - x86_64-unknown-linux-gnu
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - uses: dtolnay/rust-toolchain@stable

      - name: Check build
        run: cargo check --all-targets

      - name: Check release build
        run: cargo check --all-targets --release

      - name: Run tests
        timeout-minutes: 20
        run: cargo test --no-fail-fast -- --nocapture

  build:
    name: Build release binary
    runs-on: ubuntu-latest
    needs: [test]
    steps:
      - uses: actions/checkout@v6
      - uses: dtolnay/rust-toolchain@stable

      - name: Build release
        run: cargo build --release

      - name: Upload artifact
        uses: actions/upload-artifact@v4
        with:
          name: hpip-linux-x86_64
          path: target/release/hpip