You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sl...@apache.org on 2026/10/13 08:36:48 UTC

(maven) branch maven-4.0.x updated: Upload the Mimir caches only when they will be consolidated

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

slachiewicz pushed a commit to branch maven-4.0.x
in repository https://gitbox.apache.org/repos/asf/maven.git


The following commit(s) were added to refs/heads/maven-4.0.x by this push:
     new b8f0738496 Upload the Mimir caches only when they will be consolidated
b8f0738496 is described below

commit b8f0738496f1b9bf7cb926c323f5c8a0a90ae3b1
Author: Sylwester Lachiewicz <sl...@apache.org>
AuthorDate: Tue Oct 13 10:15:31 2026 +0200

    Upload the Mimir caches only when they will be consolidated
    
    consolidate-caches saves only on push when the POM-hash key is not stored yet; on pull requests and on a stored key the 19 uploads, about 6 GB per run, were never read.
---
 .github/workflows/maven.yml | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml
index bb09241dce..653dce47f8 100644
--- a/.github/workflows/maven.yml
+++ b/.github/workflows/maven.yml
@@ -75,6 +75,7 @@ jobs:
           cp .github/ci-extensions.xml .mvn/extensions.xml
 
       - name: Restore Mimir caches
+        id: mimir-restore
         uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
         with:
           path: ${{ env.MIMIR_LOCAL }}
@@ -104,7 +105,8 @@ jobs:
 
       - name: Upload Mimir caches
         uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
-        if: ${{ !cancelled() && !failure() }}
+        # only consolidate-caches reads these, and it saves only on push when the key is not stored yet
+        if: ${{ github.event_name != 'pull_request' && steps.mimir-restore.outputs.cache-hit != 'true' && !cancelled() && !failure() }}
         with:
           name: cache-${{ runner.os }}-initial
           retention-days: 1
@@ -183,6 +185,7 @@ jobs:
           cp .github/ci-extensions.xml ~/.m2/extensions.xml
 
       - name: Restore Mimir caches
+        id: mimir-restore
         uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
         with:
           path: ${{ env.MIMIR_LOCAL }}
@@ -228,7 +231,8 @@ jobs:
 
       - name: Upload Mimir caches
         uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
-        if: ${{ !cancelled() && !failure() }}
+        # only consolidate-caches reads these, and it saves only on push when the key is not stored yet
+        if: ${{ github.event_name != 'pull_request' && steps.mimir-restore.outputs.cache-hit != 'true' && !cancelled() && !failure() }}
         with:
           name: cache-${{ runner.os }}-full-build-${{ matrix.java }}
           retention-days: 1
@@ -287,6 +291,7 @@ jobs:
           cp .github/ci-extensions.xml ~/.m2/extensions.xml
 
       - name: Restore Mimir caches
+        id: mimir-restore
         uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
         with:
           path: ${{ env.MIMIR_LOCAL }}
@@ -305,7 +310,8 @@ jobs:
 
       - name: Upload Mimir caches
         uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
-        if: ${{ !cancelled() && !failure() }}
+        # only consolidate-caches reads these, and it saves only on push when the key is not stored yet
+        if: ${{ github.event_name != 'pull_request' && steps.mimir-restore.outputs.cache-hit != 'true' && !cancelled() && !failure() }}
         with:
           name: cache-${{ runner.os }}-integration-tests-${{ matrix.java }}
           retention-days: 1