Skip to content
Permalink
Browse files
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
  • Loading branch information
gemmellr committed Jul 1, 2022
1 parent da38fcc commit ea498e50e383138a2a4b5895b7a7f2179542e887
Showing 2 changed files with 17 additions and 14 deletions.
@@ -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
@@ -2016,5 +2016,4 @@
</snapshots>
</repository>
</repositories> -->

</project>

0 comments on commit ea498e5

Please sign in to comment.