@@ -210,3 +210,187 @@ jobs:
210210 MC_VERSION : ${{ matrix.mc_version }}
211211 JAVA_IMAGE : ${{ matrix.java_image }}
212212 FABRIC_LOADER : ${{ matrix.fabric_loader }}
213+
214+ e2e-sponge :
215+ runs-on : ubuntu-latest
216+ name : E2E - Sponge-${{ matrix.mc_version }}
217+ strategy :
218+ fail-fast : false
219+ matrix :
220+ include :
221+ - mc_version : " 1.20.6"
222+ task_suffix : " 1_20_6"
223+ java_image : " java21"
224+ spongeversion : " 1.20.6-11.0.0"
225+ - mc_version : " 1.21.1"
226+ task_suffix : " 1_21_1"
227+ java_image : " java21"
228+ spongeversion : " 1.21.1-12.0.2"
229+ - mc_version : " 1.21.3"
230+ task_suffix : " 1_21_3"
231+ java_image : " java21"
232+ spongeversion : " 1.21.3-13.0.0"
233+
234+ steps :
235+ - uses : actions/checkout@v4
236+
237+ - uses : actions/checkout@v4
238+ with :
239+ repository : BanManagement/BanManager
240+ path : BanManager
241+ ref : master
242+
243+ - name : Set up JDK 21
244+ uses : actions/setup-java@v4
245+ with :
246+ java-version : 21
247+ distribution : " temurin"
248+
249+ - name : Setup Gradle
250+ uses : gradle/actions/setup-gradle@v4
251+ with :
252+ cache-read-only : ${{ github.ref != 'refs/heads/master' }}
253+
254+ - name : Set up Docker Buildx
255+ uses : docker/setup-buildx-action@v3
256+
257+ - name : Cache Docker layers
258+ uses : actions/cache@v4
259+ with :
260+ path : /tmp/.buildx-cache
261+ key : ${{ runner.os }}-docker-e2e-${{ hashFiles('e2e/Dockerfile.tests', 'e2e/tests/package*.json') }}
262+ restore-keys : |
263+ ${{ runner.os }}-docker-e2e-
264+
265+ - name : Build test runner image
266+ uses : docker/build-push-action@v5
267+ with :
268+ context : e2e
269+ file : e2e/Dockerfile.tests
270+ push : false
271+ load : true
272+ tags : e2e-tests:latest
273+ cache-from : type=local,src=/tmp/.buildx-cache
274+ cache-to : type=local,dest=/tmp/.buildx-cache-new,mode=max
275+
276+ - name : Move Docker cache
277+ run : |
278+ rm -rf /tmp/.buildx-cache
279+ mv /tmp/.buildx-cache-new /tmp/.buildx-cache
280+
281+ - name : Build BanManager Sponge
282+ working-directory : BanManager
283+ run : ./gradlew :BanManagerSponge:shadowJar --build-cache
284+
285+ - name : Run E2E tests
286+ run : ./gradlew :BanManagerWebEnhancerE2E:testSponge_${{ matrix.task_suffix }} --build-cache -PbanManagerPath=BanManager
287+ timeout-minutes : 15
288+ env :
289+ MC_VERSION : ${{ matrix.mc_version }}
290+ JAVA_IMAGE : ${{ matrix.java_image }}
291+ SPONGEVERSION : ${{ matrix.spongeversion }}
292+
293+ - name : Collect logs on failure
294+ if : failure()
295+ working-directory : e2e/platforms/sponge
296+ run : |
297+ docker compose logs > ../../e2e-logs-sponge-${{ matrix.mc_version }}.txt 2>&1 || true
298+ env :
299+ MC_VERSION : ${{ matrix.mc_version }}
300+ JAVA_IMAGE : ${{ matrix.java_image }}
301+ SPONGEVERSION : ${{ matrix.spongeversion }}
302+
303+ - name : Upload logs on failure
304+ if : failure()
305+ uses : actions/upload-artifact@v4
306+ with :
307+ name : e2e-logs-sponge-${{ matrix.mc_version }}
308+ path : e2e-logs-sponge-${{ matrix.mc_version }}.txt
309+ retention-days : 7
310+
311+ - name : Cleanup
312+ if : always()
313+ working-directory : e2e/platforms/sponge
314+ run : docker compose down -v || true
315+ env :
316+ MC_VERSION : ${{ matrix.mc_version }}
317+ JAVA_IMAGE : ${{ matrix.java_image }}
318+ SPONGEVERSION : ${{ matrix.spongeversion }}
319+
320+ e2e-sponge7 :
321+ runs-on : ubuntu-latest
322+ name : E2E - Sponge7 (Legacy API 7)
323+
324+ steps :
325+ - uses : actions/checkout@v4
326+
327+ - uses : actions/checkout@v4
328+ with :
329+ repository : BanManagement/BanManager
330+ path : BanManager
331+ ref : master
332+
333+ - name : Set up JDK 21
334+ uses : actions/setup-java@v4
335+ with :
336+ java-version : 21
337+ distribution : " temurin"
338+
339+ - name : Setup Gradle
340+ uses : gradle/actions/setup-gradle@v4
341+ with :
342+ cache-read-only : ${{ github.ref != 'refs/heads/master' }}
343+
344+ - name : Set up Docker Buildx
345+ uses : docker/setup-buildx-action@v3
346+
347+ - name : Cache Docker layers
348+ uses : actions/cache@v4
349+ with :
350+ path : /tmp/.buildx-cache
351+ key : ${{ runner.os }}-docker-e2e-${{ hashFiles('e2e/Dockerfile.tests', 'e2e/tests/package*.json') }}
352+ restore-keys : |
353+ ${{ runner.os }}-docker-e2e-
354+
355+ - name : Build test runner image
356+ uses : docker/build-push-action@v5
357+ with :
358+ context : e2e
359+ file : e2e/Dockerfile.tests
360+ push : false
361+ load : true
362+ tags : e2e-tests:latest
363+ cache-from : type=local,src=/tmp/.buildx-cache
364+ cache-to : type=local,dest=/tmp/.buildx-cache-new,mode=max
365+
366+ - name : Move Docker cache
367+ run : |
368+ rm -rf /tmp/.buildx-cache
369+ mv /tmp/.buildx-cache-new /tmp/.buildx-cache
370+
371+ - name : Build BanManager Sponge7
372+ working-directory : BanManager
373+ run : ./gradlew :BanManagerSponge7:shadowJar --build-cache
374+
375+ - name : Run E2E tests
376+ run : ./gradlew :BanManagerWebEnhancerE2E:testSponge7 --build-cache -PbanManagerPath=BanManager
377+ timeout-minutes : 15
378+
379+ - name : Collect logs on failure
380+ if : failure()
381+ working-directory : e2e/platforms/sponge7
382+ run : |
383+ docker compose logs > ../../e2e-logs-sponge7.txt 2>&1 || true
384+
385+ - name : Upload logs on failure
386+ if : failure()
387+ uses : actions/upload-artifact@v4
388+ with :
389+ name : e2e-logs-sponge7
390+ path : e2e-logs-sponge7.txt
391+ retention-days : 7
392+
393+ - name : Cleanup
394+ if : always()
395+ working-directory : e2e/platforms/sponge7
396+ run : docker compose down -v || true
0 commit comments