name: Benchmarks

on:
  push:
    branches:
      - "master"
  pull_request:
  workflow_dispatch:

env:
  SCHEMATHESIS_BENCHMARK_SEED: "42"

jobs:
  benchmarks:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - uses: actions/setup-python@v6
        with:
          python-version: "3.12"

      - uses: astral-sh/setup-uv@v7

      - name: Run benchmarks
        uses: CodSpeedHQ/action@v4
        with:
          token: ${{ secrets.CODSPEED_TOKEN }}
          mode: "instrumentation"
          run: uvx --from=".[bench]" pytest benches/* --codspeed -p no:schemathesis -p no:hypothesispytest -p no:subtests -p no:anyio
