Skip to content

Commit

Permalink
Cache mvn repo in main build (see #1677 ) (#1678)
Browse files Browse the repository at this point in the history
Cache maven repository to decrease build times (see #1677 )

* Using latest cache action release explicitly (see egor-tensin/cmake-common@eca875b and actions/toolkit#632)

Co-authored-by: Jonas Hecht <jonas.hecht@codecentric.de>
  • Loading branch information
ccoltx and jonashackt committed Mar 30, 2021
1 parent a7d41b5 commit d8d3038
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/build-feature.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,18 @@ jobs:
with:
java-version: 1.8

- name: Cache local Maven repository
uses: actions/cache@v2.1.4
env:
cache-name: cache-mvn
with:
path: ~/.m2/repository
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
# since we also build on Windows Powershell, we need to add a space between -D maven.javadoc.skip=true
# otherwise the build will fail https://stackoverflow.com/questions/38051787/maven-javadoc-skip-true-throws-an-error
- name: Build with Maven
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/build-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,18 @@ jobs:
with:
java-version: 1.8

- name: Cache local Maven repository
uses: actions/cache@v2.1.4
env:
cache-name: cache-mvn
with:
path: ~/.m2/repository
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
# since we also build on Windows Powershell, we need to add a space between -D maven.javadoc.skip=true
# otherwise the build will fail https://stackoverflow.com/questions/38051787/maven-javadoc-skip-true-throws-an-error
- name: Build with Maven
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/build-pullrequest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,18 @@ jobs:
with:
java-version: 1.8

- name: Cache local Maven repository
uses: actions/cache@v2.1.4
env:
cache-name: cache-mvn
with:
path: ~/.m2/repository
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
# since we also build on Windows Powershell, we need to add a space between -D maven.javadoc.skip=true
# otherwise the build will fail https://stackoverflow.com/questions/38051787/maven-javadoc-skip-true-throws-an-error
- name: Build with Maven
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/release-to-maven-central.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,18 @@ jobs:
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE

- name: Cache local Maven repository
uses: actions/cache@v2.1.4
env:
cache-name: cache-mvn
with:
path: ~/.m2/repository
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Set projects Maven version to GitHub Action GUI set version
run: mvn versions:set "-DnewVersion=${{ github.event.inputs.releaseversion }}" --no-transfer-progress

Expand Down

0 comments on commit d8d3038

Please sign in to comment.