Skip to content

Commit

Permalink
Enable gametests
Browse files Browse the repository at this point in the history
  • Loading branch information
rubensworks committed Oct 12, 2024
1 parent 5fc6185 commit 65f9886
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 7 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@ jobs:
if: ${{ env.COVERALLS_REPO_TOKEN }}
run: ./gradlew test jacocoTestReport coveralls
- name: 'Game Test'
env:
GAME_TEST: ${{ secrets.GAME_TEST }}
if: ${{ env.GAME_TEST }}
run: ./gradlew runGameTestServer
- name: 'Deploy as GitHub CI artifacts'
uses: actions/upload-artifact@v4
Expand Down
11 changes: 11 additions & 0 deletions buildSrc/src/main/groovy/multiloader-loader-fabric.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,20 @@ loom {
ideConfigGenerated(true)
runDir('runs/server')
}
gameTest {
server()
setConfigName('Loader-fabric: GameTestServer')
ideConfigGenerated(true)
runDir('runs/gametest')
vmArg "-Dfabric-api.gametest"
}
}
}

task runGameTestServer {
dependsOn tasks.runGameTest
}

publishing {
publications { PublicationContainer publicationContainer ->
publicationContainer.getByName("maven") { MavenPublication publication ->
Expand Down
16 changes: 16 additions & 0 deletions buildSrc/src/main/groovy/multiloader-loader-forge.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ minecraft {

runs {
client {
property 'forge.enabledGameTestNamespaces', "cyclopscore,${mod_id}"
workingDirectory file('runs/client')
ideaModule "${rootProject.name}.${project.name}.main"
taskName 'Client'
Expand All @@ -63,6 +64,8 @@ minecraft {
}

server {
property 'forge.enabledGameTestNamespaces', "cyclopscore,${mod_id}"
args '--nogui'
workingDirectory file('runs/server')
ideaModule "${rootProject.name}.${project.name}.main"
taskName 'Server'
Expand All @@ -73,7 +76,20 @@ minecraft {
}
}

gameTestServer {
property 'forge.enabledGameTestNamespaces', "cyclopscore,${mod_id}"
workingDirectory file('runs/gametest')
ideaModule "${rootProject.name}.${project.name}.main"
taskName 'runGameTestServer'
mods {
modDataRun {
source sourceSets.main
}
}
}

data {
args '--nogui'
workingDirectory file('runs/data')
ideaModule "${rootProject.name}.${project.name}.main"
args '--mod', mod_id, '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
Expand Down
6 changes: 3 additions & 3 deletions buildSrc/src/main/groovy/multiloader-loader-neoforge.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,16 @@ runs {
}

client {
systemProperty 'neoforge.enabledGameTestNamespaces', mod_id
systemProperty 'neoforge.enabledGameTestNamespaces', "cyclopscore,${mod_id}"
}

server {
systemProperty 'neoforge.enabledGameTestNamespaces', mod_id
systemProperty 'neoforge.enabledGameTestNamespaces', "cyclopscore,${mod_id}"
programArgument '--nogui'
}

gameTestServer {
systemProperty 'neoforge.enabledGameTestNamespaces', mod_id
systemProperty 'neoforge.enabledGameTestNamespaces', "cyclopscore,${mod_id}"
}

data {
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ org.gradle.daemon=false
org.gradle.caching=true

# Common dependencies
cyclopscore_version=1.20.0-568
cyclopscore_version=1.25.1-627

0 comments on commit 65f9886

Please sign in to comment.