name: Execute Tests

on:
  pull_request:
    branches: [main]

permissions:
  contents: read
  statuses: write
  pull-requests: read

jobs:
  tests:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout code
        id: checkout-code
        uses: actions/checkout@v4

      - name: Install uv
        run: |
          curl -LsSf https://astral.sh/uv/install.sh | sh
          echo "$HOME/.local/bin" >> $GITHUB_PATH

      - name: Set up Python
        id: setup-python
        uses: actions/setup-python@v5
        with:
          python-version: "3.11"

      - name: Install dependencies
        id: install-dependencies
        run: uv sync

      - name: Run pytest
        id: run-pytest
        run: uv run pytest tests -v -s
