mirror of
https://github.com/FabricMC/fabric.git
synced 2025-03-23 21:40:02 -04:00
Add producation server test, publish testmod jar to maven. (#2717)
* Add producation server test, publish testmod jar to maven. * Fix deprecation
This commit is contained in:
parent
fa25da992d
commit
33cd7c5a40
3 changed files with 50 additions and 2 deletions
15
.github/workflows/build.yml
vendored
15
.github/workflows/build.yml
vendored
|
@ -20,8 +20,6 @@ jobs:
|
|||
with:
|
||||
reports: |
|
||||
**/build/reports/checkstyle/*.xml
|
||||
- run: mkdir run && echo "eula=true" >> run/eula.txt
|
||||
- run: ./gradlew runAutoTestServer --stacktrace --warning-mode=fail
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: Artifacts
|
||||
|
@ -54,3 +52,16 @@ jobs:
|
|||
with:
|
||||
name: Test Screenshots
|
||||
path: run/screenshots
|
||||
|
||||
server_test:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-java@v3
|
||||
with:
|
||||
distribution: 'microsoft'
|
||||
java-version: '17'
|
||||
- run: mkdir run && echo "eula=true" >> run/eula.txt
|
||||
- run: ./gradlew runProductionAutoTestServer --stacktrace --warning-mode=fail
|
||||
|
|
36
build.gradle
36
build.gradle
|
@ -423,11 +423,14 @@ configurations {
|
|||
extendsFrom configurations.loaderLibraries
|
||||
extendsFrom configurations.minecraftRuntimeOnlyLibraries
|
||||
}
|
||||
productionRuntimeServer
|
||||
}
|
||||
|
||||
dependencies {
|
||||
productionRuntime "net.fabricmc:fabric-loader:${project.loader_version}"
|
||||
productionRuntime "net.fabricmc:intermediary:${project.minecraft_version}"
|
||||
|
||||
productionRuntimeServer "net.fabricmc:fabric-installer:${project.installer_version}:server"
|
||||
}
|
||||
|
||||
import net.fabricmc.loom.util.OperatingSystem
|
||||
|
@ -465,6 +468,38 @@ task runProductionAutoTestClient(type: JavaExec, dependsOn: [remapJar, remapTest
|
|||
}
|
||||
}
|
||||
|
||||
task serverPropertiesJar(type: Jar) {
|
||||
def propsFile = file("build/tmp/install.properties")
|
||||
|
||||
doFirst {
|
||||
propsFile.text = """\
|
||||
fabric-loader-version=${project.loader_version}
|
||||
game-version=${project.minecraft_version}
|
||||
""".stripMargin().stripIndent()
|
||||
}
|
||||
|
||||
archiveFileName = "test-server-properties.jar"
|
||||
destinationDirectory = file("build/tmp")
|
||||
from(propsFile)
|
||||
}
|
||||
|
||||
task runProductionAutoTestServer(type: JavaExec, dependsOn: [remapJar, remapTestmodJar, serverPropertiesJar]) {
|
||||
classpath.from configurations.productionRuntimeServer, serverPropertiesJar
|
||||
mainClass = "net.fabricmc.installer.ServerLauncher"
|
||||
workingDir = file("run")
|
||||
|
||||
doFirst {
|
||||
workingDir.mkdirs()
|
||||
|
||||
jvmArgs(
|
||||
"-Dfabric.addMods=${remapJar.archiveFile.get().asFile.absolutePath}${File.pathSeparator}${remapTestmodJar.archiveFile.get().asFile.absolutePath}",
|
||||
"-Dfabric.autoTest"
|
||||
)
|
||||
|
||||
args("nogui")
|
||||
}
|
||||
}
|
||||
|
||||
subprojects {
|
||||
if (it.name == "deprecated") return
|
||||
|
||||
|
@ -525,6 +560,7 @@ publishing {
|
|||
}
|
||||
|
||||
artifact javadocJar
|
||||
artifact remapTestmodJar
|
||||
|
||||
pom.withXml {
|
||||
def depsNode = asNode().appendNode("dependencies")
|
||||
|
|
|
@ -5,6 +5,7 @@ version=0.68.1
|
|||
minecraft_version=1.19.3-rc1
|
||||
yarn_version=+build.1
|
||||
loader_version=0.14.10
|
||||
installer_version=0.11.1
|
||||
|
||||
prerelease=true
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue