You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ro...@apache.org on 2022/07/01 11:38:03 UTC

[activemq-artemis] branch main updated: NO-JIRA: rework GHA jobs cache config

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

robbie pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git


The following commit(s) were added to refs/heads/main by this push:
     new ea498e50e3 NO-JIRA: rework GHA jobs cache config
ea498e50e3 is described below

commit ea498e50e383138a2a4b5895b7a7f2179542e887
Author: Robbie Gemmell <ro...@apache.org>
AuthorDate: Fri Jul 1 12:32:49 2022 +0100

    NO-JIRA: rework GHA jobs cache config
    
    - Use simple path instead of earlier workarounds.
    - Add cleanup step instead to purge some output.
    - Change back to single shared cache, reduces number and combined size
      of caches, Checks job usually completes first and contains superset.
    - Change the intial key prefix so as to force a new cache
---
 .github/workflows/build.yml | 30 +++++++++++++++++-------------
 pom.xml                     |  1 -
 2 files changed, 17 insertions(+), 14 deletions(-)

diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 91c15ad152..aa3ea284ec 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -19,13 +19,10 @@ jobs:
         uses: actions/cache@v2
         with:
           path: |
-            ~/.m2/repository/*/*/*/*/*
-            !~/.m2/repository/org/apache/activemq/**/*-SNAPSHOT
-            !~/.m2/repository/org/apache/activemq/examples
-            !~/.m2/repository/org/apache/activemq/tests
-          key: ${{ runner.os }}-maven-test-${{ hashFiles('**/pom.xml') }}
+            ~/.m2/repository/
+          key: ${{ runner.os }}-mvn-${{ hashFiles('**/pom.xml') }}
           restore-keys: |
-            ${{ runner.os }}-maven-test-
+            ${{ runner.os }}-mvn-
 
       - name: Install JDK ${{ matrix.java }}
         uses: actions/setup-java@v2
@@ -39,6 +36,11 @@ jobs:
         run: |
           mvn -s .github/maven-settings.xml -Dorg.apache.activemq.artemis.core.io.aio.AIOSequentialFileFactory.DISABLED=AnythingNotNull -Pfast-tests -Ptests-CI install
 
+      - name: Clean Up Before Caching
+        run: |
+          rm -rf ~/.m2/repository/org/apache/activemq/tests
+          rm -rf ~/.m2/repository/org/apache/activemq/examples
+          if [ -d ~/.m2/repository/org/apache/activemq ]; then find ~/.m2/repository/org/apache/activemq -name "*-SNAPSHOT" -type d -prune -exec rm -r '{}' \; ; fi
 
   checks:
     name: Checks (${{ matrix.java }})
@@ -56,14 +58,10 @@ jobs:
         uses: actions/cache@v2
         with:
           path: |
-            ~/.m2/repository/*/*/*/*/*
-            !~/.m2/repository/org/apache/activemq/**/*-SNAPSHOT
-            !~/.m2/repository/org/apache/activemq/examples
-            !~/.m2/repository/org/apache/activemq/tests
-          key: ${{ runner.os }}-maven-checks-${{ hashFiles('**/pom.xml') }}
+            ~/.m2/repository/
+          key: ${{ runner.os }}-mvn-${{ hashFiles('**/pom.xml') }}
           restore-keys: |
-            ${{ runner.os }}-maven-checks-
-            ${{ runner.os }}-maven-test-
+            ${{ runner.os }}-mvn-
 
       - name: Install JDK ${{ matrix.java }}
         uses: actions/setup-java@v2
@@ -101,3 +99,9 @@ jobs:
         if: matrix.java == '11'
         run: |
           mvn -s .github/maven-settings.xml clean install -DskipTests -Prelease -am -pl "artemis-website"
+
+      - name: Clean Up Before Caching
+        run: |
+          rm -rf ~/.m2/repository/org/apache/activemq/tests
+          rm -rf ~/.m2/repository/org/apache/activemq/examples
+          if [ -d ~/.m2/repository/org/apache/activemq ]; then find ~/.m2/repository/org/apache/activemq -name "*-SNAPSHOT" -type d -prune -exec rm -r '{}' \; ; fi
diff --git a/pom.xml b/pom.xml
index 1fee723cbb..f283202f0d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -2016,5 +2016,4 @@
          </snapshots>
       </repository>
    </repositories> -->
-
 </project>