forked from dotnet/fsharp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
netci.groovy
78 lines (64 loc) · 2.49 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
import jobs.generation.Utilities;
import jobs.generation.JobReport;
def project = GithubProject
def branch = GithubBranchName
def osList = ['Windows_NT'] //'Ubuntu', 'OSX', 'CentOS7.1'
def static getBuildJobName(def configuration, def os) {
return configuration.toLowerCase() + '_' + os.toLowerCase()
}
[true, false].each { isPullRequest ->
['Debug', 'Release_ci_part1', 'Release_ci_part2'].each { configuration ->
osList.each { os ->
def lowerConfiguration = configuration.toLowerCase()
// Calculate job name
def jobName = getBuildJobName(configuration, os)
def buildCommand = '';
def buildFlavor= '';
if (configuration == "Debug") {
buildFlavor = "debug"
build_args = ""
}
else {
buildFlavor = "release"
if (configuration == "Release_ci_part1") {
build_args = "ci_part1"
}
else {
build_args = "ci_part2"
}
}
if (os == 'Windows_NT') {
buildCommand = ".\\build.cmd ${buildFlavor} ${build_args}"
}
else {
buildCommand = "./build.sh ${buildFlavor} ${build_args}"
}
def newJobName = Utilities.getFullJobName(project, jobName, isPullRequest)
def newJob = job(newJobName) {
steps {
if (os == 'Windows_NT') {
// Batch
batchFile(buildCommand)
}
else {
// Shell
shell(buildCommand)
}
}
}
// TODO: set to false after tests are fully enabled
def skipIfNoTestFiles = true
Utilities.setMachineAffinity(newJob, os, os == 'Windows_NT' ? 'latest-dev15' : 'latest-or-auto')
Utilities.standardJobSetup(newJob, project, isPullRequest, "*/${branch}")
Utilities.addArchival(newJob, "tests/TestResults/*.*", "", skipIfNoTestFiles, false)
Utilities.addArchival(newJob, "${buildFlavor}/**")
if (isPullRequest) {
Utilities.addGithubPRTriggerForBranch(newJob, branch, "${os} ${configuration} Build")
}
else {
Utilities.addGithubPushTrigger(newJob)
}
}
}
}
JobReport.Report.generateJobReport(out)