Skip to content

Commit

Permalink
Update workflows to make things more robust when it comes to caching (#…
Browse files Browse the repository at this point in the history
…239)

Motivation:

When caching fails during workflow execution we should still continue
the build as its just an optimization. Also we should use the new fork
for docker layer caching

Modifications:

- Update action that does the docker layer caching to the new fork
- Ignore errors during caching

Result:

More stable builds
  • Loading branch information
normanmaurer committed Aug 30, 2023
1 parent 5740c52 commit 1d62e3e
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci-build.yml
Expand Up @@ -36,14 +36,15 @@ jobs:

# Cache .m2/repository
- uses: actions/cache@v3
continue-on-error: true
with:
path: ~/.m2/repository
key: build-cache-m2-repository-${{ hashFiles('**/pom.xml') }}
restore-keys: |
build-cache-m2-repository-
# Enable caching of Docker layers
- uses: satackey/action-docker-layer-caching@v0.0.11
- uses: jpribyl/action-docker-layer-caching@v0.1.1
continue-on-error: true
with:
key: docker-cache-build-{hash}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/ci-deploy.yml
Expand Up @@ -45,14 +45,15 @@ jobs:

# Cache .m2/repository
- uses: actions/cache@v3
continue-on-error: true
with:
path: ~/.m2/repository
key: deploy-cache-m2-repository-${{ hashFiles('**/pom.xml') }}
restore-keys: |
deploy-cache-m2-repository-
# Enable caching of Docker layers
- uses: satackey/action-docker-layer-caching@v0.0.11
- uses: jpribyl/action-docker-layer-caching@v0.1.1
continue-on-error: true
with:
key: docker-cache-deploy-{hash}
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/ci-pr.yml
Expand Up @@ -37,6 +37,7 @@ jobs:
distribution: 'zulu'
# Cache .m2/repository
- uses: actions/cache@v3
continue-on-error: true
with:
path: ~/.m2/repository
key: verify-cache-m2-repository-${{ hashFiles('**/pom.xml') }}
Expand All @@ -53,14 +54,15 @@ jobs:

# Cache .m2/repository
- uses: actions/cache@v3
continue-on-error: true
with:
path: ~/.m2/repository
key: pr-cache-m2-repository-${{ hashFiles('**/pom.xml') }}
restore-keys: |
pr-cache-m2-repository-
# Enable caching of Docker layers
- uses: satackey/action-docker-layer-caching@v0.0.11
- uses: jpribyl/action-docker-layer-caching@v0.1.1
continue-on-error: true
with:
key: docker-cache-pr-build-{hash}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci-release.yml
Expand Up @@ -65,6 +65,7 @@ jobs:
# Cache .m2/repository
- uses: actions/cache@v3
continue-on-error: true
with:
path: ~/.m2/repository
key: release-cache-m2-repository-${{ hashFiles('**/pom.xml') }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/codeql-analysis.yml
Expand Up @@ -46,6 +46,7 @@ jobs:

# Cache .m2/repository
- uses: actions/cache@v3
continue-on-error: true
with:
path: ~/.m2/repository
key: ${{ matrix.language }}-cache-m2-repository-${{ hashFiles('**/pom.xml') }}
Expand Down

0 comments on commit 1d62e3e

Please sign in to comment.