From 2ecb4f80ea8117a624d686bb6ac4cf200d32e750 Mon Sep 17 00:00:00 2001 From: Klesti Selimaj Date: Sat, 26 Sep 2026 02:58:03 +0200 Subject: [PATCH 1/2] Move setup-java to v5 and enable Gradle's build cache - setup-java v4 is deprecated; use v5 (still with `cache: gradle`, which works once job containers can reach the runner's cache server). - Enable Gradle's build cache (org.gradle.caching) so unchanged compilations are restored from cache instead of re-run. Co-Authored-By: Claude Opus 5.5 --- .gitea/workflows/check.yml | 5 ++++- .gitea/workflows/release.yml | 5 ++++- gradle.properties | 2 ++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/check.yml b/.gitea/workflows/check.yml index a717756..eaa48a3 100644 --- a/.gitea/workflows/check.yml +++ b/.gitea/workflows/check.yml @@ -17,8 +17,11 @@ jobs: with: submodules: true + # The JDK comes from the runner's tool cache. `cache: gradle` stores Gradle's + # dependencies, Loom's Minecraft cache and the build cache in the runner's + # actions cache. - name: Set up Java 21 - uses: actions/setup-java@v4 + uses: actions/setup-java@v5 with: distribution: temurin java-version: 21 diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index f7afbf3..275c4d9 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -44,8 +44,11 @@ jobs: fi echo "Building Saturn Client $MOD_VERSION" + # The JDK comes from the runner's tool cache. `cache: gradle` stores Gradle's + # dependencies, Loom's Minecraft cache and the build cache in the runner's + # actions cache. - name: Set up Java 21 - uses: actions/setup-java@v4 + uses: actions/setup-java@v5 with: distribution: temurin java-version: 21 diff --git a/gradle.properties b/gradle.properties index b21030b..6a66e33 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,7 @@ org.gradle.jvmargs=-Xmx3G org.gradle.parallel=true +# Reuse task outputs (e.g. compiled classes) when inputs haven't changed. +org.gradle.caching=true # IntelliJ IDEA is not yet fully compatible with configuration cache, see: https://github.com/FabricMC/fabric-loom/issues/1349 org.gradle.configuration-cache=false From ff0bce4d241c762bec2ec2db39ab04d77f6d4c68 Mon Sep 17 00:00:00 2001 From: Klesti Selimaj Date: Sat, 26 Sep 2026 03:47:46 +0200 Subject: [PATCH 2/2] Run the compile check on pull requests only, not on merges A merge to master re-ran the same compile the PR had just done. Keep the pull_request trigger and drop the push-to-master one. Co-Authored-By: Claude Opus 5.5 --- .gitea/workflows/check.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/check.yml b/.gitea/workflows/check.yml index eaa48a3..c884a0c 100644 --- a/.gitea/workflows/check.yml +++ b/.gitea/workflows/check.yml @@ -1,12 +1,11 @@ name: Check -# Compiles every Minecraft version on pull requests and on pushes to master, -# so a change that breaks one version (e.g. a missed or bad port) fails before -# it's merged instead of in the release build. +# Compiles every Minecraft version on pull requests, so a change that breaks +# one version (e.g. a missed or bad port) fails before it's merged instead of +# in the release build. Merges to master aren't re-checked: the PR already +# checked that code. on: pull_request: - push: - branches: [master] jobs: compile: