name: UI Build Check
permissions:
  contents: read

on:
  pull_request:
    branches: [main]

jobs:
  build-ui:
    runs-on: ubuntu-latest
    timeout-minutes: 10
    defaults:
      run:
        working-directory: ui/litellm-dashboard

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

      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version: "20"
          cache: "npm"
          cache-dependency-path: ui/litellm-dashboard/package-lock.json

      - name: Install dependencies
        run: npm install

      - name: Build
        run: npm run build
