Skip to content

Commit 6fe71c1

Browse files
author
Abduqodiri Qurbonzoda
committed
Benchmark configs
1 parent 99a5556 commit 6fe71c1

File tree

1 file changed

+62
-1
lines changed

1 file changed

+62
-1
lines changed

.teamcity/settings.kts

Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,13 @@ project {
6565
}
6666
}
6767

68-
buildTypesOrder = listOf(buildAll, buildVersion, *builds.toTypedArray(), deployPublish, deployConfigure, *deploys.toTypedArray())
68+
val benchmarks = listOf(
69+
benchmark("js", "Linux"),
70+
benchmark("jvm", "Linux"),
71+
*platforms.map { benchmark("native", it) }.toTypedArray()
72+
)
73+
74+
buildTypesOrder = listOf(buildAll, buildVersion, *builds.toTypedArray(), deployPublish, deployConfigure, *deploys.toTypedArray(), *benchmarks.toTypedArray())
6975
}
7076

7177
fun Project.buildVersion() = BuildType {
@@ -136,6 +142,61 @@ fun Project.build(platform: String, versionBuild: BuildType) = platform(platform
136142
artifactRules = "+:build/maven=>maven\n+:build/api=>api"
137143
}
138144

145+
fun Project.benchmark(target: String, platform: String) = BuildType {
146+
// ID is prepended with Project ID, so don't repeat it here
147+
// ID should conform to identifier rules, so just letters, numbers and underscore
148+
id("${target}Benchmark_${platform.substringBefore(" ")}")
149+
// Display name of the build configuration
150+
this.name = "${target}Benchmark ($platform)"
151+
152+
153+
steps {
154+
gradle {
155+
name = "Benchmark"
156+
tasks = "${target}Benchmark"
157+
jdkHome = "%env.$jdk%"
158+
param("org.jfrog.artifactory.selectedDeployableServer.defaultModuleVersionConfiguration", "GLOBAL")
159+
}
160+
}
161+
162+
// What files to publish as build artifacts
163+
artifactRules = "benchmarks/build/reports/**=> reports"
164+
165+
requirements {
166+
equals("system.ec2.instance-type", "m5d.xlarge")
167+
contains("teamcity.agent.jvm.os.name", platform)
168+
noLessThan("teamcity.agent.hardware.memorySizeMb", "6144")
169+
}
170+
171+
params {
172+
// This parameter is needed for macOS agent to be compatible
173+
if (platform.startsWith("Mac")) param("env.JDK_17", "")
174+
}
175+
176+
// Allow to fetch build status through API for badges
177+
allowExternalStatus = true
178+
179+
// Configure VCS, by default use the same and only VCS root from which this configuration is fetched
180+
vcs {
181+
root(DslContext.settingsRoot)
182+
showDependenciesChanges = true
183+
checkoutMode = CheckoutMode.ON_AGENT
184+
}
185+
186+
failureConditions {
187+
errorMessage = true
188+
nonZeroExitCode = true
189+
executionTimeoutMin = 1440
190+
}
191+
192+
features {
193+
feature {
194+
id = "perfmon"
195+
type = "perfmon"
196+
}
197+
}
198+
}.also { buildType(it) }
199+
139200
fun BuildType.dependsOn(build: BuildType, configure: Dependency.() -> Unit) =
140201
apply {
141202
dependencies.dependency(build, configure)

0 commit comments

Comments
 (0)