name: CI

on:
  pull_request:
    branches: [main, dev]

jobs:
  validate:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout code
        uses: actions/checkout@v4

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

      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version: '22'

      - name: Install dependencies
        run: |
          bun install --frozen-lockfile
          cd ui && bun install --frozen-lockfile

      - name: Build package
        run: bun run build:all

      - name: Validate (typecheck + lint + format + tests)
        run: bun run validate
