name: CI

on:
  pull_request:
  push:
    branches:
      - main

jobs:
  test-and-contract:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v6

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

      - name: Set up Python
        uses: actions/setup-python@v6
        with:
          python-version: "3.13.11"

      - name: Sync environment
        run: uv sync

      - name: Validate finished benchmark contract
        run: uv run python scripts/validate_benchmark_contract.py

      - name: Validate finished solver contract
        run: uv run python scripts/validate_solver_contract.py

      - name: Run tests
        run: uv run pytest tests/
