forked from dotnet/corefx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
netci.groovy
60 lines (52 loc) · 1.94 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
// 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)
}
}