fix(ci): run build-jvm and build-native inside maven container image
CI / Build JVM (push) Failing after 16s
CI / Build Native (push) Failing after 51s
CI / Build & Push Native Image (push) Has been skipped

Runner has no Maven or JDK installed. Instead of installing
both manually each job, run the jobs inside the official
maven:3.9.6-eclipse-temurin-21 image which has both pre-installed.

- Drop actions/setup-java (image has JDK 21)
- Drop 'Install Maven' step (image has Maven 3.9.6)
- Add 'container: image: maven:3.9.6-eclipse-temurin-21' to each job
- Add cache for ~/.m2/repository (key on pom.xml hash)
- Keep graalvm/setup-graalvm only for the native job (adds GraalVM
  inside the container)
- docker-native job unchanged: uses the runner's docker daemon
  directly to build the image with the pre-built native binary
This commit is contained in:
2026-08-12 17:04:33 -04:00
parent f3af0f8975
commit 698e52eefc
+14 -34
View File
@@ -17,28 +17,18 @@ jobs:
build-jvm:
name: Build JVM
runs-on: ubuntu-latest
container:
image: maven:3.9.6-eclipse-temurin-21
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
- name: Cache Maven repository
uses: actions/cache@v4
with:
distribution: temurin
java-version: 21
cache: maven
- name: Install Maven
env:
MAVEN_VERSION: 3.9.6
MAVEN_HOME: ${{ runner.workspace }}/.maven
run: |
mkdir -p "$MAVEN_HOME"
if [ ! -x "$MAVEN_HOME/bin/mvn" ]; then
curl -fsSL "https://archive.apache.org/dist/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz" | tar -xz -C "$MAVEN_HOME" --strip-components=1
fi
echo "$MAVEN_HOME/bin" >> "$GITHUB_PATH"
mvn --version
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven-
- name: Cache Node + npm
uses: actions/cache@v4
@@ -61,28 +51,18 @@ jobs:
build-native:
name: Build Native
runs-on: ubuntu-latest
container:
image: maven:3.9.6-eclipse-temurin-21
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
- name: Cache Maven repository
uses: actions/cache@v4
with:
distribution: temurin
java-version: 21
cache: maven
- name: Install Maven
env:
MAVEN_VERSION: 3.9.6
MAVEN_HOME: ${{ runner.workspace }}/.maven
run: |
mkdir -p "$MAVEN_HOME"
if [ ! -x "$MAVEN_HOME/bin/mvn" ]; then
curl -fsSL "https://archive.apache.org/dist/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz" | tar -xz -C "$MAVEN_HOME" --strip-components=1
fi
echo "$MAVEN_HOME/bin" >> "$GITHUB_PATH"
mvn --version
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven-
- name: Set up GraalVM
uses: graalvm/setup-graalvm@v1