forked from dotnet/roslyn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
perf.groovy
57 lines (48 loc) · 1.79 KB
/
perf.groovy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// Groovy Script: http://www.groovy-lang.org/syntax.html
// Jenkins DSL: https://github.com/jenkinsci/job-dsl-plugin/wiki
import jobs.generation.*;
def generate(boolean isPr) {
// The input project name (e.g. dotnet/corefx)
def projectName = GithubProject
// The input branch name (e.g. master)
def branchName = GithubBranchName
def defaultBranch = "*/${branchName}"
def jobName = Utilities.getFullJobName(projectName, "perf_run", isPr)
def myJob = job(jobName) {
description('perf run')
wrappers {
credentialsBinding {
string('BV_UPLOAD_SAS_TOKEN', 'Roslyn Perf BenchView Sas')
}
}
steps {
batchFile("""powershell -File ./build/scripts/run_perf.ps1""")
}
publishers {
postBuildScripts {
steps {
batchFile("""powershell -File ./build/scripts/cleanup_perf.ps1 -ShouldArchive""")
}
}
}
}
def archiveSettings = new ArchivalSettings()
archiveSettings.addFiles('ToArchive/**/*.*')
Utilities.addArchival(myJob, archiveSettings)
Utilities.standardJobSetup(myJob, projectName, isPr, defaultBranch)
Utilities.setMachineAffinity(myJob, 'Windows_NT', 'latest-or-auto-perf')
if (isPr) {
TriggerBuilder prTrigger = TriggerBuilder.triggerOnPullRequest()
prTrigger.permitOrg('Microsoft')
prTrigger.permitOrg('dotnet')
prTrigger.setCustomTriggerPhrase("(?im)^\\s*(@dotnet-bot\\s+)?(re)?test\\s+perf(\\s+please)?\\s*\$" )
prTrigger.triggerForBranch(branchName);
prTrigger.setGithubContext('Performance Test Run')
prTrigger.emitTrigger(myJob)
}
else {
Utilities.addGithubPushTrigger(myJob)
}
}
generate(true)
generate(false)