name: PR Check

on:
  pull_request:
    branches: [main, dev-*]

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

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

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

      - name: Install dependencies
        run: |
          rm -rf node_modules package-lock.json
          npm install

      - name: Run ESLint
        run: npx eslint .

      - name: Run Prettier check
        run: npx prettier --check .

      - name: Type check
        run: npx tsc --noEmit

      - name: Build
        run: npm run build
