name: Tests

on:
  push:
  pull_request:

jobs:
  test:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v4

      - uses: actions/setup-python@v5
        with:
          python-version: "3.12"
          cache: pip

      - uses: actions/setup-node@v4
        with:
          node-version: "24"
          cache: npm

      - name: Install Python dependencies
        run: pip install -e ".[dev]"

      - name: Install Node dependencies
        run: npm install --ignore-scripts

      - name: Install frontend Node dependencies
        working-directory: frontend
        run: npm install

      - name: Run backend tests
        run: python -m pytest -q

      - name: Run frontend lint
        run: cd frontend && npm run lint

      - name: Run frontend tests
        run: npm run test
