name: Web Test

on:
  push:
    branches:
      - main
    paths:
      - 'apps/web/**'
      - '.github/workflows/web-test.yml'
  pull_request:
    branches:
      - main
    paths:
      - 'apps/web/**'
      - '.github/workflows/web-test.yml'

jobs:
  test:
    runs-on: self-hosted
    permissions:
      contents: read

    defaults:
      run:
        working-directory: apps/web

    steps:
      - uses: actions/checkout@v4

      - name: Set up Node.js
        uses: actions/setup-node@v4
        with:
          node-version: 20
          cache: 'npm'
          cache-dependency-path: apps/web/package-lock.json

      - name: Install dependencies
        run: npm ci

      - name: Build
        run: npm run build
