name: CI

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

jobs:
  lint-and-test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683  # v4.2.2
        with:
          fetch-depth: 0

      - name: Install uv
        uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b  # v7.3.0

      - name: Set up Python
        run: uv python install 3.12

      - name: Install dependencies
        run: uv venv && uv pip install ".[dev,browser]"

      - name: Lint
        run: uv run ruff check wafer/ tests/

      - name: Test
        run: uv run pytest tests/ -x -q
