name: CI

on:
  push:
    branches: [develop]
    paths-ignore:
      - ".beans/**"
      - "*.md"
      - "LICENSE"
      - ".gitignore"
      - ".github/workflows/deploy.yml"
  pull_request:
    branches: [develop]
    paths-ignore:
      - ".beans/**"
      - "*.md"
      - "LICENSE"
      - ".gitignore"
      - ".github/workflows/deploy.yml"

jobs:
  backend-lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: "3.12"
      - run: pip install ruff
      - name: Check linting
        run: ruff check backend/
      - name: Check formatting
        run: ruff format --check backend/

  frontend-lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: "24"
      - name: Install dependencies
        run: npm ci
        working-directory: frontend
      - name: Lint
        run: npm run lint
        working-directory: frontend
      - name: Type check
        run: npx tsc -b
        working-directory: frontend
