name: CI (Linux)

on: [push, pull_request]

jobs:
  build_and_test:
    strategy:
      fail-fast: false
      matrix:
        version:
          - 1.88.0 # MSRV
          - stable
          - nightly

    name: ${{ matrix.version }} - x86_64-unknown-linux-gnu
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v4

      - name: Install ${{ matrix.version }}
        uses: actions-rust-lang/setup-rust-toolchain@v1
        with:
          toolchain: ${{ matrix.version }}-x86_64-unknown-linux-gnu

      - name: Run tests (neon)
        timeout-minutes: 15
        run: |
          cargo test --all --no-default-features --features="ntex/neon"

      - name: Run tests (neon-uring)
        timeout-minutes: 15
        run: |
          cargo test --all --no-default-features --features="ntex/neon-uring"

      - name: Run tests (tokio)
        timeout-minutes: 15
        run: |
          cargo test --all --no-default-features --features="ntex/tokio"
