# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

name: JDK-EA Javadoc

on: [push, pull_request]

jobs:
  applications:
    name: Unit Test EA
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest]
        java-version: [15, 16]

    runs-on: ${{ matrix.os }}

    steps:
      - name: Git Checkout
        uses: actions/checkout@v2
      - name: 'Download JDK'
        uses: sormuras/download-jdk@v1
        id: download-jdk
        with:
          feature: ${{ matrix.java-version }}
      - name: 'Set up JDK'
        uses: actions/setup-java@v1
        with:
          java-version: ${{ steps.download-jdk.outputs.version }}
          jdkFile: "${{ steps.download-jdk.outputs.file }}"
      - name: Set Maven Wrapper
        run: mvn -N io.takari:maven:0.7.7:wrapper -Dmaven=3.6.3
      - name: 'JDK Version'
        run: java --version
      - name: Javadoc
        run: ./mvnw -Dsurefire.useFile=false -DskipTests -Denforcer.skip=true clean install javadoc:aggregate -pl '!unit-tests,!serialization-tests,!jcstress-tests,!junit-trait-runner,!unit-tests-java8,!test-coverage,!p2-repository' --no-transfer-progress
        env:
          MAVEN_OPTS: "-Xmx2g"
