From 698e52eefcbccdcaa7cca6ac61812e15cf93570e Mon Sep 17 00:00:00 2001 From: Daniel Arroyo Date: Wed, 12 Aug 2026 17:04:33 -0400 Subject: [PATCH] fix(ci): run build-jvm and build-native inside maven container image 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 --- .gitea/workflows/ci.yml | 48 ++++++++++++----------------------------- 1 file changed, 14 insertions(+), 34 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 579b0dd..26ddf21 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -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