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 c005392e46 Use upload/download-artifact instead of cache for CI
inter-job repo sharing (#2499)
c005392e46 is described below
commit c005392e4651929ef5f2e125d83791b977cd3577
Author: JB Onofré <[email protected]>
AuthorDate: Thu Apr 2 10:20:45 2026 +0200
Use upload/download-artifact instead of cache for CI inter-job repo sharing
(#2499)
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 4fb346e14f..dd343498ac 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