Skip to content

Commit

Permalink
Update workflows to make things more robust when it comes to caching (j…
Browse files Browse the repository at this point in the history
…ava-native-access#572)

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 authored Aug 30, 2023
1 parent 2361d8b commit aab4d8f
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 6 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,15 @@ jobs:

# Caching of maven dependencies
- uses: actions/cache@v3
continue-on-error: true
with:
path: ~/.m2/repository
key: build-linux-x86_64-maven-cache-${{ hashFiles('**/pom.xml') }}
restore-keys: |
build-linux-x86_64-maven-cache-
# 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: build-linux-x86_64-docker-cache-{hash}
Expand Down Expand Up @@ -76,14 +77,15 @@ jobs:

# Caching of maven dependencies
- uses: actions/cache@v3
continue-on-error: true
with:
path: ~/.m2/repository
key: build-linux-aarch64-maven-cache-${{ hashFiles('**/pom.xml') }}
restore-keys: |
build-linux-aarch64-maven-cache-
# 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: build-linux-aarch64-docker-cache-{hash}
Expand Down Expand Up @@ -143,6 +145,7 @@ jobs:

# Cache .m2/repository
- uses: actions/cache@v3
continue-on-error: true
with:
path: ~/.m2/repository
key: windows-x86_64-maven-cache-${{ hashFiles('**/pom.xml') }}
Expand Down Expand Up @@ -202,6 +205,7 @@ jobs:
# Cache .m2/repository
# Caching of maven dependencies
- uses: actions/cache@v3
continue-on-error: true
with:
path: ~/.m2/repository
key: android-maven-cache-${{ hashFiles('**/pom.xml') }}
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/ci-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ jobs:

# Caching of maven dependencies
- uses: actions/cache@v3
continue-on-error: true
with:
path: ~/.m2/repository
key: stage-snapshot-${{ matrix.setup }}-maven-cache-${{ hashFiles('**/pom.xml') }}
Expand All @@ -63,7 +64,7 @@ jobs:
}]
# Enable caching of Docker layers
- uses: satackey/action-docker-layer-caching@v0.0.11
- uses: jpribyl/action-docker-layer-caching@v0.1.1
env:
docker-cache-name: staging-${{ matrix.setup }}-cache-docker
continue-on-error: true
Expand Down Expand Up @@ -127,6 +128,7 @@ jobs:

# Caching of maven dependencies
- uses: actions/cache@v3
continue-on-error: true
with:
path: ~/.m2/repository
key: stage-snapshot-windows-x86_64-maven-cache-${{ hashFiles('**/pom.xml') }}
Expand Down Expand Up @@ -167,6 +169,7 @@ jobs:

# Caching of maven dependencies
- uses: actions/cache@v3
continue-on-error: true
with:
path: ~/.m2/repository
key: deploy-staged-snapshots-maven-cache-${{ hashFiles('**/pom.xml') }}
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/ci-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ jobs:
# Cache .m2/repository
- name: Cache local Maven repository
uses: actions/cache@v3
continue-on-error: true
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ matrix.setup }}-${{ hashFiles('**/pom.xml') }}
Expand All @@ -59,7 +60,7 @@ jobs:
${{ runner.os }}-maven-
# 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: build-docker-cache-${{ matrix.setup }}-{hash}
Expand Down Expand Up @@ -135,6 +136,7 @@ jobs:
# Cache .m2/repository
# Caching of maven dependencies
- uses: actions/cache@v3
continue-on-error: true
with:
path: ~/.m2/repository
key: pr-windows-x86_64-maven-cache-${{ hashFiles('**/pom.xml') }}
Expand Down Expand Up @@ -201,6 +203,7 @@ jobs:
# Cache .m2/repository
# Caching of maven dependencies
- uses: actions/cache@v3
continue-on-error: true
with:
path: ~/.m2/repository
key: pr-android-maven-cache-${{ hashFiles('**/pom.xml') }}
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/ci-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ jobs:

# Caching of maven dependencies
- uses: actions/cache@v3
continue-on-error: true
with:
path: ~/.m2/repository
key: prepare-release-maven-cache-${{ hashFiles('**/pom.xml') }}
Expand Down Expand Up @@ -113,14 +114,15 @@ jobs:

# Caching of maven dependencies
- uses: actions/cache@v3
continue-on-error: true
with:
path: ~/.m2/repository
key: staging-${{ matrix.setup }}-maven-cache-${{ hashFiles('**/pom.xml') }}
restore-keys: |
staging-${{ matrix.setup }}-maven-cache-
# Enable caching of Docker layers
- uses: satackey/action-docker-layer-caching@v0.0.11
- uses: jpribyl/action-docker-layer-caching@v0.1.1
env:
docker-cache-name: staging-${{ matrix.setup }}-cache-docker
continue-on-error: true
Expand Down Expand Up @@ -228,6 +230,7 @@ jobs:

# Caching of maven dependencies
- uses: actions/cache@v3
continue-on-error: true
with:
path: ~/.m2/repository
key: stage-release-windows-x86_64-maven-cache-${{ hashFiles('**/pom.xml') }}
Expand Down Expand Up @@ -321,6 +324,7 @@ jobs:

# Caching of maven dependencies
- uses: actions/cache@v3
continue-on-error: true
with:
path: ~/.m2/repository
key: deploy-staged-release-maven-cache-${{ hashFiles('**/pom.xml') }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/ci-verify-load.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,15 @@ jobs:

# Caching of maven dependencies
- uses: actions/cache@v3
continue-on-error: true
with:
path: ~/.m2/repository
key: sinstall-jars-linux-aarch64-maven-cache-${{ hashFiles('**/pom.xml') }}
restore-keys: |
install-jars-linux-aarch64-maven-cache-
# 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: pr-linux-x86_64-docker-cache-{hash}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ jobs:

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

0 comments on commit aab4d8f

Please sign in to comment.