2021-09-24 17:34:16 +02:00
|
|
|
name: Build
|
|
|
|
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
2022-12-08 20:29:50 +01:00
|
|
|
permissions:
|
|
|
|
contents: read # to fetch code (actions/checkout)
|
|
|
|
|
2021-09-24 17:34:16 +02:00
|
|
|
jobs:
|
|
|
|
build:
|
2022-09-23 23:33:28 +02:00
|
|
|
name: "Build on JDK ${{ matrix.java }}"
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
java: [ 11, 17 ]
|
2023-11-27 01:36:43 +01:00
|
|
|
# Custom JDK 21 configuration
|
|
|
|
include:
|
|
|
|
- java: 21
|
|
|
|
# Disable Enforcer check which (intentionally) prevents using JDK 21 for building
|
2023-12-06 23:52:02 +01:00
|
|
|
extra-mvn-args: -Denforcer.fail=false
|
2021-09-24 17:34:16 +02:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2024-01-29 18:00:13 +01:00
|
|
|
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
2022-09-23 23:33:28 +02:00
|
|
|
- name: "Set up JDK ${{ matrix.java }}"
|
2024-01-29 18:00:13 +01:00
|
|
|
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4.0.0
|
2021-09-24 17:34:16 +02:00
|
|
|
with:
|
|
|
|
distribution: 'temurin'
|
2022-09-23 23:33:28 +02:00
|
|
|
java-version: ${{ matrix.java }}
|
2021-09-24 17:34:16 +02:00
|
|
|
cache: 'maven'
|
|
|
|
- name: Build with Maven
|
2022-09-07 01:26:53 +02:00
|
|
|
# This also runs javadoc:jar to detect any issues with the Javadoc generated during release
|
2023-11-27 01:36:43 +01:00
|
|
|
run: mvn --batch-mode --no-transfer-progress verify javadoc:jar ${{ matrix.extra-mvn-args || '' }}
|
2023-08-13 17:44:00 +02:00
|
|
|
|
|
|
|
native-image-test:
|
|
|
|
name: "GraalVM Native Image test"
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2024-01-29 18:00:13 +01:00
|
|
|
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
2023-08-13 17:44:00 +02:00
|
|
|
- name: "Set up GraalVM"
|
2024-01-29 18:00:13 +01:00
|
|
|
uses: graalvm/setup-graalvm@b8dc5fccfbc65b21dd26e8341e7b21c86547f61b # v1.1.5.1
|
2023-08-13 17:44:00 +02:00
|
|
|
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 `graal-native-image-test` (and implicitly build and run tests in `gson`),
|
|
|
|
# everything else is covered already by regular build job above
|
2023-11-18 21:17:40 +01:00
|
|
|
run: mvn test --batch-mode --no-transfer-progress --activate-profiles native-image-test --projects graal-native-image-test --also-make
|
|
|
|
|
|
|
|
verify-reproducible-build:
|
|
|
|
name: "Verify reproducible build"
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2024-01-29 18:00:13 +01:00
|
|
|
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
2023-11-18 21:17:40 +01:00
|
|
|
- name: "Set up JDK 17"
|
2024-01-29 18:00:13 +01:00
|
|
|
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4.0.0
|
2023-11-18 21:17:40 +01:00
|
|
|
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
|