name: "Build and Test"

on:
  pull_request:
    branches: ['main']

permissions:
  contents: read

jobs:
  build:
    runs-on: ubuntu-latest
    permissions:
      contents: read  
      pull-requests: read
    timeout-minutes: 130
    steps:
      - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.5.0
      - name: Set up JDK 11
        uses: actions/setup-java@cd89f46ac9d01407894225f350157564c9c7cee2 # v3.12.0
        with:
          java-version: '11'
          distribution: 'temurin'
          cache: maven
      - name: Build with Apache Maven
        run: mvn -U clean install -Djava.awt.headless=true -fae -B
    env: 
       MAVEN_OPTS: "-Xmx1024M"

