maven.yml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. # This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
  2. # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
  3. # This workflow uses actions that are not certified by GitHub.
  4. # They are provided by a third-party and are governed by
  5. # separate terms of service, privacy policy, and support
  6. # documentation.
  7. name: Java CI with Maven
  8. on:
  9. push:
  10. branches: [ "master" ]
  11. pull_request:
  12. branches: [ "master" ]
  13. permissions:
  14. contents: read
  15. jobs:
  16. test:
  17. runs-on: ${{ matrix.os }}
  18. permissions:
  19. contents: read
  20. strategy:
  21. matrix:
  22. os: [ ubuntu-latest ]
  23. java: [ 8, 11, 17, 21 ]
  24. fail-fast: false
  25. max-parallel: 16
  26. name: Test JDK ${{ matrix.java }}, ${{ matrix.os }}
  27. steps:
  28. - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
  29. - name: Set up JDK
  30. uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
  31. with:
  32. distribution: 'temurin'
  33. java-version: ${{ matrix.java }}
  34. cache: 'maven'
  35. - name: Build with Maven if test jdk8
  36. if: ${{ matrix.java == '8' || matrix.java == '11'}}
  37. run: ./mvnw -Pgen-javadoc clean package -B
  38. - name: Build with Maven if test jdk17
  39. if: ${{ matrix.java == '17' || matrix.java == '21' }}
  40. run: ./mvnw -Penable-for-jdk17+,gen-code-cov clean package -B