ci: Add caching action of Maven artifacts
Builds are very parallelised, and this causes a huge number of requests to Maven Central. They often end up timing out or being rejected because of the excessive number of requests likely causing us to be temporarily rate-limited or similar.
Fixes
@@ -53,6 +53,14 @@ jobs:
with:
java-version: ${{ matrix.java }}
+ - name: Cache local Maven repository
+ uses: actions/cache@v2
+ with:
+ path: ~/.m2/repository
+ key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
+ restore-keys: |
+ ${{ runner.os }}-maven-
+
- name: Build Project
run: mvn clean install -Dinvoker.skip -Dmaven.javadoc.skip=true -Dmvn.test.skip=true -DskipTests=true -T1C -B
