name: CI

on:
  pull_request:
    branches: [main]

jobs:
  ci:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 20
          cache: npm
      - run: npm ci

      - name: Format check
        run: npm run format:check

      - name: Typecheck
        run: npx tsc --noEmit

      - name: Tests
        run: npx vitest run
