Enable gradle build cache for faster builds (#25)

This commit is contained in:
Raven Szewczyk 2023-06-05 19:31:04 +01:00 committed by GitHub
parent 11228f0865
commit 628e52620c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 8 deletions

View File

@ -53,10 +53,10 @@ jobs:
run: chmod +x gradlew
- name: Setup the workspace
run: ./gradlew --info --stacktrace ${{ inputs.workspace }}
run: ./gradlew --build-cache --info --stacktrace ${{ inputs.workspace }}
- name: Compile the mod
run: ./gradlew --info --stacktrace assemble
run: ./gradlew --build-cache --info --stacktrace assemble
- name: Attach compilation artifacts
uses: actions/upload-artifact@v3
@ -67,14 +67,14 @@ jobs:
- name: Run post-build checks
id: build_mod
run: ./gradlew --info --stacktrace build
run: ./gradlew --build-cache --info --stacktrace build
- name: Attempt to make a PR fixing spotless errors
if: ${{ failure() && steps.build_mod.conclusion == 'failure' && github.event_name == 'pull_request' && !github.event.pull_request.draft }}
run: |
git reset --hard
git checkout "${PR_BRANCH}"
./gradlew --info --stacktrace spotlessApply || exit 1
./gradlew --build-cache --info --stacktrace spotlessApply || exit 1
git diff --exit-code && exit 1
git config user.name "GitHub GTNH Actions"
git config user.email "<>"
@ -100,7 +100,7 @@ jobs:
mkdir -p run
echo "eula=true" > run/eula.txt
echo "stop" > run/stop.txt
timeout ${{ inputs.timeout }} ./gradlew --info --stacktrace runServer 2>&1 < run/stop.txt | tee -a server.log || true
timeout ${{ inputs.timeout }} ./gradlew --build-cache --info --stacktrace runServer 2>&1 < run/stop.txt | tee -a server.log || true
- name: Test no errors reported during server run
if: ${{ !inputs.client-only }}

View File

@ -49,10 +49,10 @@ jobs:
run: chmod +x gradlew
- name: Setup the workspace
run: ./gradlew --info --stacktrace ${{ inputs.workspace }}
run: ./gradlew --build-cache --info --stacktrace ${{ inputs.workspace }}
- name: Build the mod
run: ./gradlew --info --stacktrace build
run: ./gradlew --build-cache --info --stacktrace build
# Continue on error in the following steps to make sure releases still get made even if one of the methods fails
@ -78,7 +78,7 @@ jobs:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish to Maven, Modrinth and CurseForge
run: ./gradlew --info --stacktrace build publish
run: ./gradlew --build-cache --info --stacktrace build publish
continue-on-error: true
env:
MAVEN_USER: ${{ secrets.MAVEN_USER }}