-
-
Notifications
You must be signed in to change notification settings - Fork 4
209 lines (190 loc) · 6.89 KB
/
e2e.yml
File metadata and controls
209 lines (190 loc) · 6.89 KB
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
201
202
203
204
205
206
207
208
209
name: E2E Tests
permissions:
contents: read
on:
pull_request:
push:
branches:
- master
workflow_dispatch:
jobs:
e2e:
runs-on: ubuntu-latest
name: E2E - ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
include:
# Bukkit/Paper
- platform: Bukkit
task: testBukkit
build_task: ":BanManagerBukkit:shadowJar"
compose_dir: platforms/bukkit
# Fabric 1.20.1 (legacy modded, Java 17)
- platform: Fabric-1.20.1
task: testFabric_1_20_1
build_task: ":fabric:1.20.1:remapJar"
compose_dir: platforms/fabric
mc_version: "1.20.1"
java_image: "java17"
fabric_loader: "0.16.10"
# Fabric 1.21.1 (stable 1.21, Java 21)
- platform: Fabric-1.21.1
task: testFabric_1_21_1
build_task: ":fabric:1.21.1:remapJar"
compose_dir: platforms/fabric
mc_version: "1.21.1"
java_image: "java21"
fabric_loader: "0.16.9"
# Fabric 1.21.4 (current latest, Java 21)
- platform: Fabric-1.21.4
task: testFabric_1_21_4
build_task: ":fabric:1.21.4:remapJar"
compose_dir: platforms/fabric
mc_version: "1.21.4"
java_image: "java21"
fabric_loader: "0.16.9"
# Fabric 1.21.11 (current latest, Java 21)
- platform: Fabric-1.21.11
task: testFabric_1_21_11
build_task: ":fabric:1.21.11:remapJar"
compose_dir: platforms/fabric
mc_version: "1.21.11"
java_image: "java21"
fabric_loader: "0.17.3"
# Sponge API 11 (MC 1.20.6, Java 21)
- platform: Sponge-1.20.6
task: testSponge_1_20_6
build_task: ":BanManagerSponge:shadowJar"
compose_dir: platforms/sponge
mc_version: "1.20.6"
java_image: "java21"
spongeversion: "1.20.6-11.0.0"
# Sponge API 12 (MC 1.21.1, Java 21)
- platform: Sponge-1.21.1
task: testSponge_1_21_1
build_task: ":BanManagerSponge:shadowJar"
compose_dir: platforms/sponge
mc_version: "1.21.1"
java_image: "java21"
spongeversion: "1.21.1-12.0.2"
# Sponge API 13 (MC 1.21.3, Java 21)
- platform: Sponge-1.21.3
task: testSponge_1_21_3
build_task: ":BanManagerSponge:shadowJar"
compose_dir: platforms/sponge
mc_version: "1.21.3"
java_image: "java21"
spongeversion: "1.21.3-13.0.0"
# Sponge API 7 (Legacy - MC 1.12.2, Java 8)
- platform: Sponge7-1.12.2
task: testSponge7
build_task: ":BanManagerSponge7:shadowJar"
compose_dir: platforms/sponge7
mc_version: "1.12.2"
java_image: "java8"
# Velocity Proxy
- platform: Velocity
task: testVelocity
build_task: ":BanManagerVelocity:shadowJar"
compose_dir: platforms/velocity
# BungeeCord Proxy
- platform: BungeeCord
task: testBungee
build_task: ":BanManagerBungee:shadowJar"
compose_dir: platforms/bungee
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
repository: BanManagement/BanManager
path: BanManager
ref: master
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: 21
distribution: "temurin"
# Also set up JDK 17 for Fabric 1.20.x builds
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: "temurin"
# Ensure JDK 21 is the default
- name: Set JDK 21 as default
run: echo "JAVA_HOME=$JAVA_HOME_21_X64" >> $GITHUB_ENV
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
cache-read-only: ${{ github.ref != 'refs/heads/master' }}
- uses: actions/cache@v4
with:
path: |
.gradle/loom-cache
key: ${{ runner.os }}-loom-${{ hashFiles('**/libs.versions.*', '**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: ${{ runner.os }}-loom-
# Docker Buildx for better caching
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# Cache Docker layers for test runner image
- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-docker-e2e-${{ hashFiles('e2e/Dockerfile.tests', 'e2e/tests/package*.json') }}
restore-keys: |
${{ runner.os }}-docker-e2e-
# Pre-build the test runner image with cache
- name: Build test runner image
uses: docker/build-push-action@v5
with:
context: e2e
file: e2e/Dockerfile.tests
push: false
load: true
tags: e2e-tests:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
# Move cache to avoid ever-growing cache
- name: Move Docker cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
- name: Build BanManager plugin JARs
working-directory: BanManager
run: ./gradlew ${{ matrix.build_task }} --build-cache
- name: Run E2E tests
run: ./gradlew :BanManagerWebEnhancerE2E:${{ matrix.task }} --build-cache -PbanManagerPath=BanManager
timeout-minutes: 15
env:
MC_VERSION: ${{ matrix.mc_version }}
JAVA_IMAGE: ${{ matrix.java_image }}
FABRIC_LOADER: ${{ matrix.fabric_loader }}
SPONGEVERSION: ${{ matrix.spongeversion }}
- name: Collect logs on failure
if: failure()
working-directory: e2e/${{ matrix.compose_dir }}
run: |
docker compose logs > ../../e2e-logs-${{ matrix.platform }}.txt 2>&1 || true
env:
MC_VERSION: ${{ matrix.mc_version }}
JAVA_IMAGE: ${{ matrix.java_image }}
FABRIC_LOADER: ${{ matrix.fabric_loader }}
SPONGEVERSION: ${{ matrix.spongeversion }}
- name: Upload logs on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: e2e-logs-${{ matrix.platform }}
path: e2e-logs-${{ matrix.platform }}.txt
retention-days: 7
- name: Cleanup
if: always()
working-directory: e2e/${{ matrix.compose_dir }}
run: docker compose down -v || true
env:
MC_VERSION: ${{ matrix.mc_version }}
JAVA_IMAGE: ${{ matrix.java_image }}
FABRIC_LOADER: ${{ matrix.fabric_loader }}
SPONGEVERSION: ${{ matrix.spongeversion }}