From 3f7e34d382ac9ee4ab31752a912b51f82fa0a756 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?JB=20Onofr=C3=A9?= Date: Sat, 14 Mar 2026 06:45:26 +0100 Subject: [PATCH] fix(ci): make test job depend on build to resolve SNAPSHOT artifacts The test job runs with -Ptest profile which disables assembly packaging (install-kar, package phases set to none). This means artifacts like apache-karaf:tar.gz are never built during the test job. Previously, build and test ran as independent parallel jobs on separate runners, so the test job could not resolve these SNAPSHOT artifacts. Fix by: - Adding needs: build so the test job runs after build completes - Saving the Maven local repository from build via actions/cache/save - Restoring it in the test job via actions/cache/restore - Removing clean from the test Maven command so local repo is preserved --- .github/workflows/ci.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dfa564f9db3..581f7b8aac5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,15 +45,21 @@ jobs: cache: 'maven' - name: Build run: mvn -U -B -e clean install -Prat -DskipTests "-Dinvoker.skip=true" + - name: Save Maven Local Repository + uses: actions/cache/save@v4 + with: + path: ~/.m2/repository + key: maven-local-repo-${{ github.run_id }} test: name: test + needs: build permissions: contents: read checks: write pull-requests: write - + runs-on: ubuntu-24.04 steps: @@ -65,8 +71,13 @@ jobs: java-version: '11' distribution: 'temurin' cache: 'maven' + - name: Restore Maven Local Repository + uses: actions/cache/restore@v4 + with: + path: ~/.m2/repository + key: maven-local-repo-${{ github.run_id }} - name: Test - run: mvn -U -B -e clean install -Ptest + run: mvn -B -e install -Ptest - name: Upload Test Results if: (!cancelled()) uses: actions/upload-artifact@v4