forked from dotnet/corefx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnetci.groovy
98 lines (84 loc) · 3.57 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
// Import the utility functionality.
import jobs.generation.Utilities;
def project = 'dotnet/corefx'
// **************************
// Define code coverage build
// **************************
[true, false].each { isPR ->
def newJob = job(Utilities.getFullJobName(project, 'code_coverage_windows', isPR)) {
steps {
batchFile('call "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\Tools\\VsDevCmd.bat" && build.cmd /p:Coverage=true')
}
}
// Set up standard options
Utilities.standardJobSetup(newJob, project, isPR)
// Set the machine affinity to windows machines
Utilities.setMachineAffinity(newJob, 'Windows_NT')
// Publish reports
Utilities.addHtmlPublisher(newJob, 'bin/tests/coverage', 'Code Coverage Report', 'index.htm')
// Archive results.
Utilities.addArchival(newJob, '**/coverage/*,msbuild.log')
// Set triggers
if (isPR) {
// Set PR trigger
Utilities.addGithubPRTrigger(newJob, 'Code Coverage Windows Debug', 'test code coverage')
}
else {
// Set a periodic trigger
Utilities.addPeriodicTrigger(newJob, '@daily')
}
}
// **************************
// Define code formatter check build
// **************************
[true, false].each { isPR ->
def newJob = job(Utilities.getFullJobName(project, 'native_code_format_check', isPR)) {
steps {
shell('python src/Native/format-code.py checkonly')
}
}
// Set up standard options.
Utilities.standardJobSetup(newJob, project, isPR)
// Set the machine affinity to Ubuntu machines
Utilities.setMachineAffinity(newJob, 'Ubuntu')
if (isPR) {
// Set PR trigger. Only trigger when the phrase is said.
Utilities.addGithubPRTrigger(newJob, 'Code Formatter Check', '(?i).*test\\W+code\\W+formatter\\W+check.*', true)
}
else {
// Set a push trigger
Utilities.addGithubPushTrigger(newJob)
}
}
// **************************
// Define outerloop windows testing. Run locally on each machine.
// **************************
def osShortName = ['Windows 10': 'win10', 'Windows 7' : 'win7', 'Windows_NT' : 'windows_nt']
[true, false].each { isPR ->
['Windows 10', 'Windows 7', 'Windows_NT'].each { os ->
['Debug', 'Release'].each { configuration ->
def newJobName = "outerloop_${osShortName[os]}_${configuration.toLowerCase()}"
def newJob = job(Utilities.getFullJobName(project, newJobName, isPR)) {
steps {
batchFile("call \"C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\vcvarsall.bat\" x86 && Build.cmd /p:Configuration=${configuration} /p:WithCategories=\"InnerLoop;OuterLoop\" /p:TestWithLocalLibraries=true")
}
}
// Set the affinity. OS name matches the machine affinity.
Utilities.setMachineAffinity(newJob, os)
// Set up standard options.
Utilities.standardJobSetup(newJob, project, isPR)
// Add the unit test results
Utilities.addXUnitDotNETResults(newJob, 'bin/tests/**/testResults.xml')
// Set up appropriate triggers. PR on demand, otherwise nightly
if (isPR) {
// Set PR trigger.
// TODO: More elaborate regex trigger?
Utilities.addGithubPRTrigger(newJob, "OuterLoop ${os} ${configuration}", "(?i).*test\\W+outerloop.*")
}
else {
// Set a periodic trigger
Utilities.addPeriodicTrigger(newJob, '@daily')
}
}
}
}