Skip to content

Commit 0a74741

Browse files
committed
fix: neoforge gametests
it just silently failed before * merge test/main sourcesets * include gametests in jar * attempt to speed up actions
1 parent 2e4d5ae commit 0a74741

File tree

19 files changed

+170
-553
lines changed

19 files changed

+170
-553
lines changed

.github/workflows/codeql.yml

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: CodeQL
2+
3+
on:
4+
workflow_run:
5+
workflows: [ Commit ]
6+
types:
7+
- completed
8+
9+
jobs:
10+
codeql:
11+
runs-on: ubuntu-22.04
12+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
17+
- name: Validate Gradle wrapper
18+
uses: gradle/wrapper-validation-action@v2
19+
20+
- name: Setup JDK 17
21+
uses: actions/setup-java@v4
22+
with:
23+
java-version: 17
24+
distribution: temurin
25+
26+
- name: Cache gradle dependencies
27+
uses: actions/cache/restore@v4
28+
with:
29+
fail-on-cache-miss: true
30+
path: |
31+
~/.gradle/caches
32+
~/.gradle/wrapper
33+
.gradle
34+
common/.gradle
35+
fabric/.gradle
36+
neoforge/.gradle
37+
neoforge/build/jars
38+
neoforge/build/neoForge
39+
neoforge/build/neoForm
40+
neoforge/build/tmp/neoFormRecompile
41+
key: ${{ runner.os }}-gradle-${{ hashFiles('gradle/gradle-wrapper.properties', 'settings.gradle.kts', '**/build.gradle.kts', '**/gradle.properties') }}-${{github.ref_name}}
42+
43+
- name: Initialize build environment
44+
run: ./gradlew
45+
46+
- name: Initialize CodeQL
47+
uses: github/codeql-action/init@v3
48+
with:
49+
languages: java
50+
51+
- name: Build
52+
run: ./gradlew assemble -x checkLicenses --no-daemon
53+
54+
- name: Perform CodeQL Analysis
55+
uses: github/codeql-action/analyze@v3

.github/workflows/commit.yml

+22-192
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ on:
55
branches: [ 'minecraft/*' ]
66

77
jobs:
8-
initialize:
8+
build:
99
runs-on: ubuntu-22.04
1010
steps:
1111
- name: Checkout repository
1212
uses: actions/checkout@v4
1313

1414
- name: Validate Gradle wrapper
15-
uses: gradle/wrapper-validation-action@v1
15+
uses: gradle/wrapper-validation-action@v2
1616

1717
- name: Setup JDK 17
1818
uses: actions/setup-java@v4
@@ -26,208 +26,38 @@ jobs:
2626
path: |
2727
~/.gradle/caches
2828
~/.gradle/wrapper
29-
./.gradle
30-
./common/.gradle
31-
./fabric/.gradle
32-
./neoforge/.gradle
33-
key: ${{ runner.os }}-gradle-${{github.ref_name}}-${{ hashFiles('gradle/gradle-wrapper.properties', 'settings.gradle.kts', 'build.gradle.kts', 'gradle.properties') }}
29+
.gradle
30+
common/.gradle
31+
fabric/.gradle
32+
neoforge/.gradle
33+
neoforge/build/jars
34+
neoforge/build/neoForge
35+
neoforge/build/neoForm
36+
neoforge/build/tmp/neoFormRecompile
37+
key: ${{ runner.os }}-gradle-${{ hashFiles('gradle/gradle-wrapper.properties', 'settings.gradle.kts', '**/build.gradle.kts', '**/gradle.properties') }}-${{github.ref_name}}
3438
restore-keys: |
35-
${{ runner.os }}-gradle-${{github.ref_name}}-
39+
${{ runner.os }}-gradle-${{ hashFiles('gradle/gradle-wrapper.properties', 'settings.gradle.kts', '**/build.gradle.kts', '**/gradle.properties') }}
3640
${{ runner.os }}-gradle-
3741
38-
- name: Initialize caches
39-
run: ./gradlew --no-daemon
40-
41-
license-headers:
42-
needs: initialize
43-
runs-on: ubuntu-22.04
44-
steps:
45-
- name: Checkout repository
46-
uses: actions/checkout@v4
47-
48-
- name: Setup JDK 17
49-
uses: actions/setup-java@v4
50-
with:
51-
java-version: 17
52-
distribution: temurin
53-
54-
- name: Restore gradle cache
55-
uses: actions/cache/restore@v4
56-
with:
57-
fail-on-cache-miss: true
58-
path: |
59-
~/.gradle/caches
60-
~/.gradle/wrapper
61-
./.gradle
62-
./common/.gradle
63-
./fabric/.gradle
64-
./neoforge/.gradle
65-
key: ${{ runner.os }}-gradle-${{github.ref_name}}-${{ hashFiles('gradle/gradle-wrapper.properties', 'settings.gradle.kts', 'build.gradle.kts', 'gradle.properties') }}
66-
67-
- name: License headers
68-
run: ./gradlew checkLicenses --no-daemon
69-
70-
build:
71-
needs: initialize
72-
runs-on: ubuntu-22.04
73-
74-
steps:
75-
- name: Checkout repository
76-
uses: actions/checkout@v4
77-
78-
- name: Setup JDK 17
79-
uses: actions/setup-java@v4
80-
with:
81-
java-version: 17
82-
distribution: temurin
83-
84-
- name: Restore gradle cache
85-
uses: actions/cache/restore@v4
86-
with:
87-
fail-on-cache-miss: true
88-
path: |
89-
~/.gradle/caches
90-
~/.gradle/wrapper
91-
./.gradle
92-
./common/.gradle
93-
./fabric/.gradle
94-
./neoforge/.gradle
95-
key: ${{ runner.os }}-gradle-${{github.ref_name}}-${{ hashFiles('gradle/gradle-wrapper.properties', 'settings.gradle.kts', 'build.gradle.kts', 'gradle.properties') }}
96-
97-
- name: Build
98-
run: ./gradlew assemble testClasses -x checkLicenses --no-daemon
99-
100-
- name: Cache build output
101-
uses: actions/cache/save@v4
102-
with:
103-
path: |
104-
./common/build
105-
./fabric/build
106-
./neoforge/build
107-
key: ${{ runner.os }}-build-${{ github.sha }}
108-
109-
analysis:
110-
needs: initialize
111-
runs-on: ubuntu-22.04
112-
permissions:
113-
security-events: write
114-
115-
steps:
116-
- name: Checkout repository
117-
uses: actions/checkout@v4
118-
119-
- name: Setup JDK 17
120-
uses: actions/setup-java@v4
121-
with:
122-
java-version: 17
123-
distribution: temurin
124-
125-
- name: Restore gradle cache
126-
uses: actions/cache/restore@v4
127-
with:
128-
fail-on-cache-miss: true
129-
path: |
130-
~/.gradle/caches
131-
~/.gradle/wrapper
132-
./.gradle
133-
./common/.gradle
134-
./fabric/.gradle
135-
./neoforge/.gradle
136-
key: ${{ runner.os }}-gradle-${{github.ref_name}}-${{ hashFiles('gradle/gradle-wrapper.properties', 'settings.gradle.kts', 'build.gradle.kts', 'gradle.properties') }}
42+
- name: Initialize build environment
43+
run: ./gradlew
13744

138-
- name: Initialize CodeQL
139-
uses: github/codeql-action/init@v3
140-
with:
141-
languages: java
45+
- name: Check license headers
46+
run: ./gradlew checkLicenses
14247

14348
- name: Build
144-
run: ./gradlew assemble testClasses -x checkLicenses --no-daemon
145-
146-
- name: Perform CodeQL Analysis
147-
uses: github/codeql-action/analyze@v3
148-
149-
test:
150-
needs: build
151-
runs-on: ubuntu-22.04
152-
153-
steps:
154-
- name: Checkout repository
155-
uses: actions/checkout@v4
156-
157-
- name: Setup JDK 17
158-
uses: actions/setup-java@v4
159-
with:
160-
java-version: 17
161-
distribution: temurin
162-
163-
- name: Restore gradle cache
164-
uses: actions/cache/restore@v4
165-
with:
166-
fail-on-cache-miss: true
167-
path: |
168-
~/.gradle/caches
169-
~/.gradle/wrapper
170-
./.gradle
171-
./common/.gradle
172-
./fabric/.gradle
173-
./neoforge/.gradle
174-
key: ${{ runner.os }}-gradle-${{github.ref_name}}-${{ hashFiles('gradle/gradle-wrapper.properties', 'settings.gradle.kts', 'build.gradle.kts', 'gradle.properties') }}
175-
176-
- name: Restore cached build output
177-
uses: actions/cache/restore@v4
178-
with:
179-
fail-on-cache-miss: true
180-
path: |
181-
.gradle/
182-
!.gradle/loom-cache
183-
build/
184-
key: ${{ runner.os }}-build-${{ github.sha }}
49+
if: ${{ !cancelled() }}
50+
id: build
51+
run: ./gradlew assemble -x checkLicenses
18552

18653
- name: Test
187-
run: ./gradlew :fabric:runGametest :neoforge:runGameTestServer --no-daemon
188-
189-
publish:
190-
if: github.repository == 'TeamGalacticraft/DynamicDimensions'
191-
needs: [ test, license-headers, analysis ]
192-
runs-on: ubuntu-22.04
193-
194-
steps:
195-
- name: Checkout repository
196-
uses: actions/checkout@v4
197-
198-
- name: Setup JDK 17
199-
uses: actions/setup-java@v4
200-
with:
201-
java-version: 17
202-
distribution: temurin
203-
204-
- name: Restore gradle cache
205-
uses: actions/cache/restore@v4
206-
with:
207-
fail-on-cache-miss: true
208-
path: |
209-
~/.gradle/caches
210-
~/.gradle/wrapper
211-
./.gradle
212-
./common/.gradle
213-
./fabric/.gradle
214-
./neoforge/.gradle
215-
key: ${{ runner.os }}-gradle-${{github.ref_name}}-${{ hashFiles('gradle/gradle-wrapper.properties', 'settings.gradle.kts', 'build.gradle.kts', 'gradle.properties') }}
216-
217-
- name: Restore cached build output
218-
uses: actions/cache/restore@v4
219-
with:
220-
fail-on-cache-miss: true
221-
path: |
222-
.gradle/
223-
!.gradle/loom-cache
224-
build/
225-
key: ${{ runner.os }}-build-${{ github.sha }}
54+
if: ${{ steps.build.outcome == 'success' && !cancelled() }}
55+
run: ./gradlew :fabric:runGametest :neoforge:runGameTestServer
22656

22757
- name: Publish
58+
if: ${{ github.repository == 'TeamGalacticraft/DynamicDimensions' && success() }}
22859
run: ./gradlew publish -x test --no-daemon
22960
env:
230-
BUILD_NUMBER: ${{ github.run_number }}
23161
NEXUS_REPOSITORY_URL: ${{ secrets.NEXUS_RELEASE_URL }}
23262
NEXUS_USER: ${{ secrets.NEXUS_USER }}
23363
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}

0 commit comments

Comments
 (0)