name: CI (dev & main)

on:
  push:
    branches:
      - dev
      - main
  pull_request:
    branches:
      - main

jobs:
  ci:
    runs-on: ubuntu-latest

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

      - name: Setup Bun
        uses: oven-sh/setup-bun@v1
        with:
          bun-version: "1.1.8"

      - name: Install dependencies
        run: bun install

      # ตรงนี้ถ้ามี test จริง ค่อยเปลี่ยนคำสั่ง
      - name: Run tests (placeholder)
        run: |
          echo "No tests yet"
          # ตัวอย่าง: bun test หรือ bun run lint

      - name: Docker build check
        run: |
          docker build -t cdp-ydm-ci .
