name: CI - Type Check, Format & Lint

on:
  pull_request:

jobs:
  quality-checks:
    name: Quality Checks
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - name: Setup Bun
        uses: oven-sh/setup-bun@v2
        with:
          bun-version: 1.3.6

      - name: Install dependencies
        run: bun install --frozen-lockfile

      - name: Run TypeScript type checking
        run: bunx turbo run check-types --filter='@supermemory/ai-sdk' --filter='@supermemory/memory-graph'

      - name: Run Biome CI (format & lint on changed files)
        run: bunx biome ci --changed --since=origin/main --no-errors-on-unmatched
