diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b51f5fa33..2f80da1ff 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -41,7 +41,6 @@ jobs: - name: Load m2 repository cache # Manually caching .m2 repo as the setup-java caching isn't falling back to older caches id: cached-m2-repo uses: actions/cache@v4 - if: always() with: path: ~/.m2/repository key: maven-${{ hashFiles('**/pom.xml') }} @@ -50,7 +49,6 @@ jobs: - name: Load m2 build cache id: cached-m2-build uses: actions/cache@v4 - if: always() with: path: ~/.m2/build-cache key: maven-build-cache-${{ hashFiles('**/pom.xml') }} @@ -79,6 +77,23 @@ jobs: ./get_helm.sh - name: Build aiSSEMBLE run: ./mvnw -B clean install --file pom.xml -Dhabushu.usePyenv=false -Pci + #NB: The following two explicit cache saves are necessary to ensure caches are saved on build failure, until + # https://github.com/actions/cache/issues/1315 is resolved + - name: Save m2 repository cache + id: save-m2-repo + uses: actions/cache/save@v4 + if: always() + with: + path: ~/.m2/repository + key: maven-${{ hashFiles('**/pom.xml') }} + - name: Save m2 build cache + id: save-m2-build + uses: actions/cache/save@v4 + if: always() + with: + path: ~/.m2/build-cache + key: maven-build-cache-${{ hashFiles('**/pom.xml') }} + # # Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive # - name: Update dependency graph