name: PR Compile Check

on:
  pull_request:
    branches:
      - main
  workflow_dispatch:

env:
  FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true

jobs:
  compile:
    name: Compile (Java 17)
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v4.1.7

      - name: Set up Java 17
        uses: actions/setup-java@v4.1.0
        with:
          distribution: temurin
          java-version: "17"

      - name: Ensure mvnw is executable
        run: chmod +x mvnw

      - name: Compile
        run: ./mvnw -B -DskipTests compile
