Skip to content

Commit

Permalink
Use maven dependency caching (#94)
Browse files Browse the repository at this point in the history
Motivation:

To reduce the likelyness of build failures due network problems it is best to cache maven dependencies.

Modifications:

- Correctly mount .m2/repository
- Use action for caching

Result:

More stable builds
  • Loading branch information
normanmaurer authored May 5, 2021
1 parent ce60e89 commit e05e720
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ jobs:
steps:
- uses: actions/checkout@v2

# Cache .m2/repository
- uses: actions/cache@v2
with:
path: ~/.m2/repository
key: build-${{ matrix.setup }}-cache-m2-repository-${{ hashFiles('**/pom.xml') }}
restore-keys: |
build-${{ matrix.setup }}-cache-m2-repository-
# Enable caching of Docker layers
- uses: satackey/action-docker-layer-caching@v0.0.11
continue-on-error: true
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/ci-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ jobs:
steps:
- uses: actions/checkout@v2

# Cache .m2/repository
- uses: actions/cache@v2
with:
path: ~/.m2/repository
key: stage-snapshot-${{ matrix.setup }}-cache-m2-repository-${{ hashFiles('**/pom.xml') }}
restore-keys: |
stage-snapshot-${{ matrix.setup }}-cache-m2-repository-
# Enable caching of Docker layers
- uses: satackey/action-docker-layer-caching@v0.0.11
env:
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/ci-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ jobs:
steps:
- uses: actions/checkout@v2

# Cache .m2/repository
- uses: actions/cache@v2
with:
path: ~/.m2/repository
key: build-pr-${{ matrix.setup }}-cache-m2-repository-${{ hashFiles('**/pom.xml') }}
restore-keys: |
build-pr-${{ matrix.setup }}-cache-m2-repository-
# Enable caching of Docker layers
- uses: satackey/action-docker-layer-caching@v0.0.11
continue-on-error: true
Expand Down
1 change: 1 addition & 0 deletions docker/docker-compose.centos-6.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ services:
depends_on: [runtime-setup]
volumes:
- ~/.ssh:/root/.ssh:delegated
- ~/.m2/repository:/root/.m2/repository
- ..:/code:delegated
working_dir: /code

Expand Down
2 changes: 2 additions & 0 deletions docker/docker-compose.centos-7.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ services:
image: netty-io_uring:cross_compile_aarch64
volumes:
- ~/.ssh:/root/.ssh:delegated
- ~/.m2/repository:/root/.m2/repository
- ..:/code:delegated
working_dir: /code

Expand All @@ -25,6 +26,7 @@ services:
volumes:
- ~/.ssh:/root/.ssh
- ~/.gnupg:/root/.gnupg
- ~/.m2/repository:/root/.m2/repository
- ~/.m2/settings.xml:/root/.m2/settings.xml
- ..:/code

Expand Down

0 comments on commit e05e720

Please sign in to comment.