name: Test

on:
  pull_request:
    types: [opened, synchronize, edited, enqueued]
  push:
  release:
    types: [created, prereleased, published]

jobs:
  default-debug:
    runs-on: windows-latest
    name: Debug
    steps:
      - uses: actions-rust-lang/setup-rust-toolchain@v1
      - uses: actions/checkout@v5
      - run: cargo test

  default-release:
    runs-on: macos-latest
    name: Release
    steps:
      - uses: actions-rust-lang/setup-rust-toolchain@v1
      - uses: actions/checkout@v5
      - run: cargo test --release

  all-features-debug:
    runs-on: ubuntu-latest
    name: All Features Debug
    steps:
      - uses: actions-rust-lang/setup-rust-toolchain@v1
      - uses: actions/checkout@v5
      - run: cargo test --all-features

  all-features-release:
    runs-on: ubuntu-latest
    name: All Features Debug
    steps:
      - uses: actions-rust-lang/setup-rust-toolchain@v1
      - uses: actions/checkout@v5
      - run: cargo test --release --all-features

  bench-test:
    runs-on: ubuntu-latest
    name: Benchmark Tests
    steps:
      - uses: actions-rust-lang/setup-rust-toolchain@v1
      - uses: actions/checkout@v5
      - run: RUSTFLAGS="-D warnings" cargo test --benches --all-features

  bench-run:
    runs-on: ubuntu-latest
    name: Benchmarks
    steps:
      - uses: actions-rust-lang/setup-rust-toolchain@v1
      - uses: actions/checkout@v5
      - run: cargo bench --all-features
