# 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: [18]

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

    steps:
      - name: Git Checkout
        uses: actions/checkout@v3
      - name: Download JDK ${{ matrix.java-version }} from jdk.java.net
        uses: oracle-actions/setup-java@v1
        id: download-jdk
        with:
          website: jdk.java.net
          release: ${{ matrix.java-version }}
      - name: 'Print outputs'
        shell: bash
        run: |
          echo 'Outputs'
          echo "steps.download-jdk.outputs.archive = ${{ steps.download-jdk.outputs.archive }}"
          echo "steps.download-jdk.outputs.version = ${{ steps.download-jdk.outputs.version }}"
      - 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,!org.eclipse.collections:org.eclipse.collections' --no-transfer-progress
        env:
          MAVEN_OPTS: "-Xmx2g"
