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 38fc57c commit e8a8c1e
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 8 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,7 @@ 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
run: ./gradlew runGameTestServer -x :loader-forge:downloadAssets
- name: 'Deploy as GitHub CI artifacts'
uses: actions/upload-artifact@v4
with:
Expand Down
12 changes: 12 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 All @@ -49,3 +60,4 @@ publishing {
}
}
}

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,6 +76,18 @@ 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 {
workingDirectory file('runs/data')
ideaModule "${rootProject.name}.${project.name}.main"
Expand Down Expand Up @@ -108,3 +123,4 @@ sourceSets.forEach {
it.output.resourcesDir = dir
it.java.destinationDirectory = dir
}

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.22.0-595
cyclopscore_version=1.25.1-627

0 comments on commit e8a8c1e

Please sign in to comment.