Skip to content

Commit bacc188

Browse files
committed
Attempt to make our Game Tests run on push whenever we change a java file
1 parent b792593 commit bacc188

File tree

3 files changed

+48
-3
lines changed

3 files changed

+48
-3
lines changed

.github/workflows/codeql.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,13 @@ on:
55
branches: [ "1.20.4" ]
66
pull_request:
77
branches: [ "1.20.4" ]
8-
paths-ignore:
9-
- '**/lang/*.json'
8+
types:
9+
- synchronize
10+
- opened
11+
- ready_for_review
12+
- reopened
13+
paths:
14+
- '**.java'
1015
schedule:
1116
- cron: "57 19 * * 4"
1217

.github/workflows/gametests.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: "Run Game Tests"
2+
3+
on:
4+
push:
5+
branches: [ "1.20.4" ]
6+
pull_request:
7+
branches: [ "1.20.4" ]
8+
types:
9+
- synchronize
10+
- opened
11+
- ready_for_review
12+
- reopened
13+
paths:
14+
- '**.java'
15+
16+
jobs:
17+
test:
18+
name: Game Tests
19+
timeout-minutes: 60
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v4
25+
26+
- name: Set up JDK 17
27+
uses: actions/setup-java@v4
28+
with:
29+
java-version: '17'
30+
distribution: 'temurin'
31+
32+
- name: Build with Gradle
33+
uses: gradle/gradle-build-action@v3
34+
with:
35+
gradle-version: wrapper
36+
arguments: :runGameTestServer
37+
cache-read-only: false

src/gameTest/java/mekanism/common/tests/MekanismTests.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package mekanism.common.tests;
22

33
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
4+
import java.nio.file.Path;
45
import net.minecraft.commands.CommandSourceStack;
56
import net.minecraft.commands.Commands;
67
import net.minecraft.resources.ResourceLocation;
@@ -13,6 +14,8 @@
1314
import net.neoforged.testframework.conf.Feature;
1415
import net.neoforged.testframework.conf.FrameworkConfiguration;
1516
import net.neoforged.testframework.impl.MutableTestFramework;
17+
import net.neoforged.testframework.summary.GitHubActionsStepSummaryDumper;
18+
import net.neoforged.testframework.summary.JUnitSummaryDumper;
1619
import org.lwjgl.glfw.GLFW;
1720

1821
@Mod(MekanismTests.MODID)
@@ -29,7 +32,7 @@ public MekanismTests(IEventBus modBus, ModContainer container) {
2932
.build())
3033
.enable(Feature.CLIENT_SYNC, Feature.TEST_STORE)
3134
//TODO: Figure out which dumpers we want to enable and how they work
32-
//.dumpers(new JUnitSummaryDumper(Path.of("gameTest/")), new GitHubActionsStepSummaryDumper())
35+
.dumpers(new JUnitSummaryDumper(Path.of("gameTest/")), new GitHubActionsStepSummaryDumper())
3336
.build().create();
3437

3538
framework.init(modBus, container);

0 commit comments

Comments
 (0)