From a198436c074727133128f3cd5b7754e6f7892563 Mon Sep 17 00:00:00 2001 From: david Date: Sat, 17 Jan 2026 19:47:47 +0100 Subject: [PATCH] Add Gradle caching to CI workflows --- .github/workflows/build.yml | 12 ++++++++++++ .github/workflows/maven-publish.yml | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b80788c..2dc68ef 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,6 +13,18 @@ jobs: java-version: 21 - name: Setup Gradle uses: gradle/actions/setup-gradle@v5 + with: + cache-read-only: ${{ github.ref != 'refs/heads/main' }} + - name: Cache Gradle Build Cache + uses: actions/cache@v5 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + .gradle + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle.properties') }} + restore-keys: | + ${{ runner.os }}-gradle- - name: Cache Hytale Server uses: actions/cache@v5 with: diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml index 4c1bf8c..191afba 100644 --- a/.github/workflows/maven-publish.yml +++ b/.github/workflows/maven-publish.yml @@ -15,6 +15,18 @@ jobs: java-version: 21 - name: Setup Gradle uses: gradle/actions/setup-gradle@v5 + with: + cache-read-only: ${{ github.ref != 'refs/heads/main' }} + - name: Cache Gradle Build Cache + uses: actions/cache@v5 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + .gradle + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle.properties') }} + restore-keys: | + ${{ runner.os }}-gradle- - name: Cache Hytale Server uses: actions/cache@v5 with: