name: CI

on:
  push:
  pull_request:

jobs:
  backend:
    name: Backend Checks
    runs-on: docker
    steps:
      - name: Check out repository
        uses: https://data.forgejo.org/actions/checkout@v4

      - name: Install uv
        run: curl -LsSf https://astral.sh/uv/install.sh | sh

      - name: Run backend quality checks
        run: |
          export PATH="${HOME}/.local/bin:${PATH}"
          ./scripts/check_python_quality.sh

  frontend:
    name: Frontend Checks
    runs-on: docker
    steps:
      - name: Check out repository
        uses: https://data.forgejo.org/actions/checkout@v4

      - name: Install Bun
        run: curl -fsSL https://bun.sh/install | bash

      - name: Install frontend dependencies
        run: ${HOME}/.bun/bin/bun install --cwd frontend --frozen-lockfile

      - name: Run frontend quality checks
        run: ./scripts/check_frontend_quality.sh
