hpip 0.2.0

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

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:
  test:
    strategy:
      fail-fast: false
      matrix:
        target:
          - x86_64-apple-darwin
          - aarch64-apple-darwin

    name: Test (stable) - ${{ matrix.target }}
    runs-on: macos-latest

    steps:
      - uses: actions/checkout@v7
      - 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 - ${{ matrix.target }}
    runs-on: macos-latest
    needs: [test]
    strategy:
      fail-fast: false
      matrix:
        target:
          - x86_64-apple-darwin
          - aarch64-apple-darwin

    steps:
      - uses: actions/checkout@v7
      - uses: dtolnay/rust-toolchain@stable
        with:
          targets: ${{ matrix.target }}

      - name: Build release
        run: cargo build --release --target ${{ matrix.target }}

      - name: Upload artifact
        uses: actions/upload-artifact@v7
        with:
          name: hpip-${{ matrix.target }}
          path: target/${{ matrix.target }}/release/hpip