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
This commit is contained in:
Robbie Gemmell 2022-07-01 12:32:49 +01:00
parent da38fcce71
commit ea498e50e3
2 changed files with 17 additions and 14 deletions

View File

@ -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

View File

@ -2016,5 +2016,4 @@
</snapshots>
</repository>
</repositories> -->
</project>