name: CI

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

jobs:
  build-and-test:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v4

      - uses: oven-sh/setup-bun@v2
        with:
          bun-version: latest

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

      - name: Build
        run: bun run build

      - name: Typecheck
        run: bun run typecheck

      - name: Validate skills
        run: bun run validate

      - name: Check generated files are up-to-date
        run: bun run build:from-skills:check

      - name: Test
        run: bun test
