name: Build and Test App
on:
  push:
    paths:
      - 'app/**'
      - '.gitea/workflows/test-app.yaml'
  pull_request:
    types: [opened, reopened, synchronize]
jobs:
  Build-and-test-App:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Setup NodeJS
        uses: actions/setup-node@v4
        with:
          node-version: '22.x'
          cache: 'npm'
          cache-dependency-path: app/package-lock.json
      - name: Install Project
        working-directory: ./app
        run: npm ci
      - name: Lint
        working-directory: ./app
        run: npm run lint
      - name: Type-Check
        working-directory: ./app
        run: npm run type-check
      - name: Build
        working-directory: ./app
        run: npm run build-only
