This is an automated email from the ASF dual-hosted git repository.

jbonofre pushed a commit to branch karaf-4.4.x
in repository https://gitbox.apache.org/repos/asf/karaf.git


The following commit(s) were added to refs/heads/karaf-4.4.x by this push:
     new 24933baced fix(ci): make test job depend on build to resolve SNAPSHOT 
artifacts (#2321)
24933baced is described below

commit 24933baced085b7c54955967add7e29e39503bb8
Author: JB Onofré <[email protected]>
AuthorDate: Sat Mar 14 08:35:24 2026 +0100

    fix(ci): make test job depend on build to resolve SNAPSHOT artifacts (#2321)
    
    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 dfa564f9db..581f7b8aac 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

Reply via email to