mirror of
https://github.com/GTNewHorizons/GTNH-Actions-Workflows.git
synced 2025-07-01 18:01:28 +02:00
Enable gradle build cache for faster builds (#25)
This commit is contained in:
parent
11228f0865
commit
628e52620c
10
.github/workflows/build-and-test.yml
vendored
10
.github/workflows/build-and-test.yml
vendored
@ -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 }}
|
||||
|
6
.github/workflows/release-tags.yml
vendored
6
.github/workflows/release-tags.yml
vendored
@ -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 }}
|
||||
|
Loading…
x
Reference in New Issue
Block a user