name: Build P2
concurrency: 
    group: ${{ github.workflow }}-${{ github.ref }}
    cancel-in-progress: true

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v3
      with:
        fetch-depth: 0 # required for jgit timestamp provider to work
    - name: Set up JDK 11
      uses: actions/setup-java@v3
      with:
        java-version: '17'
        distribution: 'temurin'
        cache: maven
    - run: echo "::add-matcher::.github/matcher.json"
    - name: Build with Maven
      uses: GabrielBB/xvfb-action@v1
      with:
       run: mvn clean verify --batch-mode -Pbuild-individual-bundles -Pbree-libs -Papi-check -Dcompare-version-with-baselines.skip=false -Dproject.build.sourceEncoding=UTF-8 --global-toolchains=.github/toolchains-gh.xml -T1C
