summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2021-06-22 14:13:22 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2021-06-22 14:29:57 +0200
commit147951f39de8f93eba6c7b0b7e6e5c9d2bce32e7 (patch)
treee034e01c1eea52704c84070c886cdced2576351d /.github
parentba32561e4b0e00c00d528df615a58e396e0fddc0 (diff)
ci: Optimize Gradle build performance in Github Actions
This change updates the Github Actions Gradle workflows in order to improve the runtime performance of these workflows. We have now enabled build caching as well as parallel builds to speed up the build process. Moreover, we now cache the Gradle wrapper.
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/build.yml17
-rw-r--r--.github/workflows/release.yml17
2 files changed, 26 insertions, 8 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 28e5846b..257ad2e3 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -26,16 +26,25 @@ jobs:
java-version: ${{ matrix.java }}
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- - uses: actions/cache@v1
+ - uses: actions/cache@v2
with:
- path: ~/.gradle/caches
- key: ${{ runner.os }}-${{ matrix.java }}-gradle-${{ hashFiles('**/*.gradle*') }}
+ path: |
+ ~/.gradle/caches
+ ~/.gradle/wrapper
+ key: ${{ runner.os }}-${{ matrix.java }}-gradle-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-${{ matrix.java }}-gradle-
- name: Build with Gradle
- run: ./gradlew assemble
+ run: ./gradlew classes
- name: Check with Gradle
run: ./gradlew check codeCoverageReport
+ - name: Cleanup Gradle Daemons
+ run: ./gradlew --stop
+ - name: Cleanup Gradle Cache
+ run: |
+ rm -f ~/.gradle/caches/modules-2/modules-2.lock
+ rm -f ~/.gradle/caches/modules-2/gc.properties
+ shell: bash
- name: Publish report
if: always()
uses: mikepenz/action-junit-report@v2
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index f76cdd09..c525eb97 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
- java: [ 15 ]
+ java: [ 16 ]
steps:
- name: Checkout repository
uses: actions/checkout@v2
@@ -22,10 +22,12 @@ jobs:
java-version: ${{ matrix.java }}
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- - uses: actions/cache@v1
+ - uses: actions/cache@v2
with:
- path: ~/.gradle/caches
- key: ${{ runner.os }}-${{ matrix.java }}-gradle-${{ hashFiles('**/*.gradle*') }}
+ path:|
+ ~/.gradle/caches
+ ~/.gradle/wrapper
+ key: ${{ runner.os }}-${{ matrix.java }}-gradle-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-${{ matrix.java }}-gradle-
- name: Build with Gradle
@@ -46,3 +48,10 @@ jobs:
files: build/distributions/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ - name: Cleanup Gradle Daemons
+ run: ./gradlew --stop
+ - name: Cleanup Gradle Cache
+ run: |
+ rm -f ~/.gradle/caches/modules-2/modules-2.lock
+ rm -f ~/.gradle/caches/modules-2/gc.properties
+ shell: bash