name: Run Tests

'on':
  push:
    branches:
      - development
    paths:
      - "**/*.py"
      - "tests/**"
      - ".github/workflows/run-tests.yml"
  pull_request:
    branches:
      - development
      - main

jobs:
  test:
    runs-on: ubuntu-latest
    name: Test Suite
    env:
      FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
    steps:
      - name: Checkout code
        uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4

      - name: Install uv
        uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5

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

      - name: Install dependencies
        run: uv sync --group dev

      - name: Black formatting check
        run: uv run black --check --diff src/ tests/

      - name: Lint
        run: uv run --with flake8 flake8 src/ --count --max-line-length=160 --show-source --statistics

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