From b228f766aed5d6a3e57740a668be46ad3105a2bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?JB=20Onofr=C3=A9?= Date: Wed, 1 Apr 2026 18:43:08 +0200 Subject: [PATCH] Use upload/download-artifact instead of cache for CI inter-job repo sharing The cache/save and cache/restore actions are subject to GitHub's 7-day cache eviction policy. When a test job is re-run after the cache expires, the Maven local repository is empty and SNAPSHOT artifacts like apache-karaf:tar.gz cannot be resolved, causing build failures. Switching to upload-artifact/download-artifact ties the Maven local repo to the workflow run itself, making test job re-runs reliable regardless of cache expiration. --- .github/workflows/ci.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fb2c1e7c309..4361a0b1a0f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,10 +46,11 @@ jobs: - name: Build run: mvn -U -B -e clean install -Prat -DskipTests "-Dinvoker.skip=true" - name: Save Maven Local Repository - uses: actions/cache/save@v5 + uses: actions/upload-artifact@v7 with: + name: maven-local-repo path: ~/.m2/repository - key: maven-local-repo-${{ github.run_id }} + retention-days: 1 test: name: test @@ -70,10 +71,10 @@ jobs: distribution: 'temurin' cache: 'maven' - name: Restore Maven Local Repository - uses: actions/cache/restore@v5 + uses: actions/download-artifact@v4 with: + name: maven-local-repo path: ~/.m2/repository - key: maven-local-repo-${{ github.run_id }} - name: Test run: mvn -B -e install -Ptest timeout-minutes: 180