Skip to content

Commit 84491a7

Browse files
Try running both gametests in a single job
1 parent 1f1f01e commit 84491a7

2 files changed

Lines changed: 15 additions & 50 deletions

File tree

.github/workflows/gradle.yml

Lines changed: 13 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,7 @@ on:
2828

2929
jobs:
3030
build:
31-
name: Build
3231
runs-on: ubuntu-latest
33-
outputs:
34-
matrix: ${{ steps.set_matrix.outputs.matrix }}
3532
steps:
3633

3734
- name: Echo distinct ID ${{ inputs.distinct_id }}
@@ -90,63 +87,29 @@ jobs:
9087
done
9188
echo "</details>" >> $GITHUB_STEP_SUMMARY
9289
93-
- name: Set up test matrix
94-
id: set_matrix
95-
run: |
96-
DO_LOOTR_TEST=$(grep -E '^do_lootr_test=' gradle.properties | cut -d'=' -f2)
97-
98-
if [ "$DO_LOOTR_TEST" = "true" ]; then
99-
echo 'matrix={"include":[{"name":"default","task":"runClientGameTest"},{"name":"lootr","task":"runClientGameTestWithLootr"}]}' >> $GITHUB_OUTPUT
100-
else
101-
echo 'matrix={"include":[{"name":"default","task":"runClientGameTest"}]}' >> $GITHUB_OUTPUT
102-
fi
103-
104-
test:
105-
name: Run ${{ matrix.name }} client gametest
106-
needs: build
107-
runs-on: ubuntu-latest
108-
strategy:
109-
fail-fast: false
110-
matrix: ${{ fromJson(needs.build.outputs.matrix) }}
111-
steps:
112-
113-
- name: Checkout repository
114-
uses: actions/checkout@v5
115-
116-
- name: Set up Java 21
117-
uses: actions/setup-java@v5
118-
with:
119-
java-version: "21"
120-
distribution: "microsoft"
121-
122-
- name: Grant execute permission for gradlew
123-
run: chmod +x gradlew
124-
125-
- name: Setup Gradle
126-
uses: gradle/actions/setup-gradle@v4
127-
with:
128-
build-scan-publish: true
129-
build-scan-terms-of-use-url: "https://gradle.com/help/legal-terms-of-use"
130-
build-scan-terms-of-use-agree: "yes"
131-
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
132-
cache-read-only: ${{ github.ref != 'refs/heads/master' && !startsWith(github.ref, 'refs/heads/1.') }}
133-
134-
- name: Run ${{ matrix.name }} client gametest
90+
- name: Run client gametests
13591
env:
13692
IMGUR_CLIENT_ID: ${{ secrets.IMGUR_CLIENT_ID }}
137-
run: xvfb-run --auto-servernum ./gradlew ${{ matrix.task }} --build-cache --stacktrace --warning-mode=fail
93+
run: xvfb-run --auto-servernum ./gradlew runClientGameTest runClientGameTestWithLootr --build-cache --stacktrace --warning-mode=fail
13894

139-
- name: Upload screenshots artifact
95+
- name: Upload screenshots
14096
uses: actions/upload-artifact@v4
14197
if: ${{ success() || failure() }}
14298
with:
143-
name: screenshots-${{ matrix.name }}
99+
name: screenshots
144100
path: build/run/*/screenshots
145101
compression-level: 0
146102

147-
- name: Upload crash-reports artifact
103+
- name: Upload logs
104+
uses: actions/upload-artifact@v4
105+
if: ${{ success() || failure() }}
106+
with:
107+
name: logs
108+
path: build/run/*/logs/latest.log
109+
110+
- name: Upload crash reports
148111
uses: actions/upload-artifact@v4
149112
if: ${{ failure() }}
150113
with:
151-
name: crash-reports-${{ matrix.name }}
114+
name: crash-reports
152115
path: build/run/*/crash-reports

build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,9 @@ def prepareClientGameTestWithLootr = tasks.register("prepareClientGameTestWithLo
125125
into layout.buildDirectory.dir("run/clientGameTestWithLootr/mods")
126126
}
127127

128+
def doLootrTest = providers.gradleProperty("do_lootr_test").map { it.toBoolean() }.orElse(false)
128129
tasks.named("runClientGameTestWithLootr") {
130+
onlyIf { doLootrTest.get() }
129131
dependsOn prepareClientGameTestWithLootr
130132
}
131133

0 commit comments

Comments
 (0)