name: Checks

on: [push, pull_request]

jobs:
  clippy:
    name: Clippy
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions-rust-lang/setup-rust-toolchain@v1
        with:
          toolchain: stable
          components: clippy
      - run:
          cargo clippy --tests --all --no-default-features --features="ntex-net/tokio"

  fmt:
    name: Rustfmt
    runs-on: ubuntu-latest
    strategy:
      matrix:
        rust:
          - stable
    steps:
      - uses: actions/checkout@v4
      - uses: actions-rust-lang/setup-rust-toolchain@v1
        with:
          toolchain: ${{ matrix.rust }}
          components: rustfmt
          rustflags: --profile minimal
      - run: cargo fmt --all -- --check
