forked from dotnet/roslyn-analyzers
-
Notifications
You must be signed in to change notification settings - Fork 1
/
netci.groovy
34 lines (29 loc) · 1.32 KB
/
netci.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
// Import the utility functionality.
import jobs.generation.Utilities;
// Defines a the new of the repo, used elsewhere in the file
def project = GithubProject
def branch = GithubBranchName
// Generate the builds for debug and release, commit and PRJob
[true, false].each { isPR -> // Defines a closure over true and false, value assigned to isPR
['Debug', 'Release'].each { configuration ->
def newJobName = Utilities.getFullJobName(project, "windows_${configuration.toLowerCase()}", isPR)
def newJob = job(newJobName) {
// This opens the set of build steps that will be run.
steps {
// Indicates that a batch script should be run with the build string (see above)
// Also available is:
// shell (for unix scripting)
batchFile("cibuild.cmd /${configuration.toLowerCase()}")
}
}
Utilities.setMachineAffinity(newJob, 'Windows_NT', 'latest-or-auto')
Utilities.standardJobSetup(newJob, project, isPR, "*/${branch}")
Utilities.addXUnitDotNETResults(newJob, "**/*TestResults.xml")
if (isPR) {
Utilities.addGithubPRTriggerForBranch(newJob, branch, "Windows ${configuration}")
}
else {
Utilities.addGithubPushTrigger(newJob)
}
}
}