forked from FabricMC/fabric-loom
-
Notifications
You must be signed in to change notification settings - Fork 42
200 lines (169 loc) · 5.36 KB
/
test-push.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
name: Run Tests
on: [push, pull_request]
concurrency:
group: build-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
strategy:
fail-fast: false
matrix:
version: [8.6.0-jdk17]
runs-on: ubuntu-22.04
container:
image: gradle:${{ matrix.version }}
options: --user root
steps:
- uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v2
- run: gradle build check -x test --stacktrace --warning-mode fail
- uses: Juuxel/publish-checkstyle-report@v1
if: ${{ failure() }}
with:
reports: |
build/reports/checkstyle/*.xml
build_windows:
runs-on: windows-2022
steps:
- uses: actions/checkout@v4
- name: setup jdk
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'temurin'
- uses: gradle/wrapper-validation-action@v2
- run: ./gradlew build check -x test --stacktrace --warning-mode fail
# This job is used to feed the test matrix of next job to allow the tests to run in parallel
prepare_test_matrix:
# Lets wait to ensure it builds before going running tests
needs: build
runs-on: ubuntu-22.04
container:
image: gradle:8.6.0-jdk17
options: --user root
steps:
- uses: actions/checkout@v4
- run: gradle writeActionsTestMatrix --stacktrace --warning-mode fail
-
id: set-matrix
run: echo "matrix=$(cat build/test_matrix.json)" >> $GITHUB_OUTPUT
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
run_tests:
needs: prepare_test_matrix
strategy:
fail-fast: false
matrix:
version: [8.6.0-jdk17]
test: ${{ fromJson(needs.prepare_test_matrix.outputs.matrix) }}
runs-on: ubuntu-22.04
container:
image: gradle:${{ matrix.version }}
options: --user root
steps:
- uses: actions/checkout@v4
- run: gradle printActionsTestName --name="${{ matrix.test }}" test --tests ${{ matrix.test }} --stacktrace --warning-mode fail
env:
TEST_WARNING_MODE: fail
id: test
- uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: ${{ steps.test.outputs.test }} Results
path: build/reports/
- uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: ${{ steps.test.outputs.test }} Heap Dump
path: "*.hprof"
run_tests_windows:
needs: prepare_test_matrix
strategy:
fail-fast: false
matrix:
java: [17]
test: ${{ fromJson(needs.prepare_test_matrix.outputs.matrix) }}
runs-on: windows-2022
steps:
- uses: actions/checkout@v4
- name: setup jdk ${{ matrix.java }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
- run: ./gradlew printActionsTestName --name="${{ matrix.test }}" test --tests ${{ matrix.test }} --stacktrace --warning-mode fail
env:
TEST_WARNING_MODE: fail
id: test
- uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: ${{ steps.test.outputs.test }} (${{ matrix.java }}) Results (Windows)
path: build/reports/
- uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: ${{ steps.test.outputs.test }} Heap Dump (Windows)
path: "*.hprof"
# Special case this test to run across all os's
reproducible_build_test:
needs: build
strategy:
fail-fast: false
matrix:
java: [ 17, 21 ]
os: [ windows-2022, ubuntu-22.04, macos-14 ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
- run: ./gradlew test --tests *ReproducibleBuildTest --stacktrace --warning-mode fail
- uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: Reproducible Build ${{ matrix.os }} (${{ matrix.java }}) Results
path: build/reports/
# Special case this test to run on Java 21
neoForge1206Test:
needs: build
strategy:
fail-fast: false
matrix:
java: [ 21 ]
os: [ ubuntu-22.04 ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
- run: ./gradlew test --tests *NeoForge1206Test --stacktrace --warning-mode fail
- uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: NeoForge 1.20.6 Build Results
# Special case this test to run on Java 21
forge1206Test:
needs: build
strategy:
fail-fast: false
matrix:
java: [ 21 ]
os: [ ubuntu-22.04 ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
- run: ./gradlew test --tests *Forge1206Test --stacktrace --warning-mode fail
- uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: Forge 1.20.6 Build Results
path: build/reports/