Build for Java 8 rather than Java 7. (#2744) #1903
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: [push, pull_request] | |
permissions: | |
contents: read # to fetch code (actions/checkout) | |
jobs: | |
build: | |
name: "Build on JDK ${{ matrix.java }}" | |
strategy: | |
matrix: | |
java: [ 11, 17 ] | |
# Custom JDK 21 configuration | |
include: | |
- java: 21 | |
# Disable Enforcer check which (intentionally) prevents using JDK 21 for building | |
extra-mvn-args: -Denforcer.fail=false | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- name: "Set up JDK ${{ matrix.java }}" | |
uses: actions/setup-java@6a0805fcefea3d4657a47ac4c165951e33482018 # v4.2.2 | |
with: | |
distribution: 'temurin' | |
java-version: ${{ matrix.java }} | |
cache: 'maven' | |
- name: Build with Maven | |
# This also runs javadoc:jar to detect any issues with the Javadoc generated during release | |
run: mvn --batch-mode --no-transfer-progress verify javadoc:jar ${{ matrix.extra-mvn-args || '' }} | |
native-image-test: | |
name: "GraalVM Native Image test" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- name: "Set up GraalVM" | |
uses: graalvm/setup-graalvm@22cc13fe88ef133134b3798e128fb208df55e1f5 # v1.2.3 | |
with: | |
java-version: '17' | |
distribution: 'graalvm' | |
# According to documentation in graalvm/setup-graalvm this is used to avoid rate-limiting issues | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
cache: 'maven' | |
- name: Build and run tests | |
# Only run tests in `test-graal-native-image` (and implicitly build and run tests in `gson`), | |
# everything else is covered already by regular build job above | |
run: mvn test --batch-mode --no-transfer-progress --activate-profiles native-image-test --projects test-graal-native-image --also-make | |
verify-reproducible-build: | |
name: "Verify reproducible build" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- name: "Set up JDK 17" | |
uses: actions/setup-java@6a0805fcefea3d4657a47ac4c165951e33482018 # v4.2.2 | |
with: | |
distribution: 'temurin' | |
java-version: 17 | |
cache: 'maven' | |
- name: "Verify no plugin issues" | |
run: mvn artifact:check-buildplan --batch-mode --no-transfer-progress | |
- name: "Verify reproducible build" | |
# See https://maven.apache.org/guides/mini/guide-reproducible-builds.html#how-to-test-my-maven-build-reproducibility | |
run: | | |
mvn clean install --batch-mode --no-transfer-progress -Dproguard.skip -DskipTests | |
# Run with `-Dbuildinfo.attach=false`; otherwise `artifact:compare` fails because it creates a `.buildinfo` file which | |
# erroneously references the existing `.buildinfo` file (respectively because it is overwriting it, a file with size 0) | |
# See https://issues.apache.org/jira/browse/MARTIFACT-57 | |
mvn clean verify artifact:compare --batch-mode --no-transfer-progress -Dproguard.skip -DskipTests -Dbuildinfo.attach=false |