pipeline:
  build_test:
    image: maven:3.9-eclipse-temurin-17
    when:
      event: [ push, pull_request, tag ]
    commands:
      - ./scripts/ci/logs-health-check.sh
      - ./scripts/ci/clean-artifacts.sh --include-build-outputs --fail-on-found
      - ./scripts/ci/backend-verify.sh
      - ./scripts/ci/assert-migration-not-skipped.sh

  frontend_admin_check:
    image: node:20
    when:
      event: [ push, pull_request, tag ]
    commands:
      - npm --prefix frontend/admin ci
      - npm --prefix frontend/admin run type-check
      - npm --prefix frontend/admin run test -- --run

  package:
    image: maven:3.9-eclipse-temurin-17
    when:
      event: [ push, tag ]
    commands:
      - mvn -B -DskipTests clean package
