diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 768f198d..c8a098eb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,10 +24,17 @@ jobs: distribution: 'adopt' cache: maven - name: Cache Maven packages - uses: actions/cache@v4.0.2 + id: restore-maven-package-cache + uses: actions/cache/restore@v4.0.2 with: path: ~/.m2 key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} restore-keys: ${{ runner.os }}-m2 - name: Build with Maven run: mvn -B verify + - name: Save downloaded Maven packages + uses: actions/cache/save@v4.0.2 + with: + path: ~/.m2 + key: ${{ steps.restore-maven-package-cache.outputs.cache-primary-key }} + if: github.event_name != 'pull_request' \ No newline at end of file diff --git a/.github/workflows/early-access.yml b/.github/workflows/early-access.yml index ede96980..bceaddb2 100644 --- a/.github/workflows/early-access.yml +++ b/.github/workflows/early-access.yml @@ -74,7 +74,8 @@ jobs: if: matrix.os == 'ubuntu-latest' - name: Cache Maven packages - uses: actions/cache@v4.0.2 + id: restore-maven-package-cache + uses: actions/cache/restore@v4.0.2 with: path: ~/.m2 key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} @@ -103,6 +104,13 @@ jobs: target/distributions/*.zip target/distributions/*.tar.gz + - name: Save downloaded Maven packages + uses: actions/cache/save@v4.0.2 + with: + path: ~/.m2 + key: ${{ steps.restore-maven-package-cache.outputs.cache-primary-key }} + if: github.event_name != 'pull_request' + # Collect all executables and release release: needs: [ build ] diff --git a/.github/workflows/mutation-testing.yml b/.github/workflows/mutation-testing.yml index fc39c658..854cc238 100644 --- a/.github/workflows/mutation-testing.yml +++ b/.github/workflows/mutation-testing.yml @@ -18,6 +18,13 @@ jobs: # Disabling shallow clone is recommended for improving relevancy of reporting fetch-depth: 0 + - name: Cache Maven packages + uses: actions/cache@v4.0.2 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2 + - name: Set up JDK uses: actions/setup-java@v4.2.2 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bb02db41..ba07efc4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,7 +28,7 @@ jobs: distribution: 'adopt' - name: Cache Maven packages - uses: actions/cache@v4.0.2 + uses: actions/cache/restore@v4.0.2 with: path: ~/.m2 key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}