forked from dotnet/orleans
-
Notifications
You must be signed in to change notification settings - Fork 0
/
netci.groovy
69 lines (58 loc) · 2.75 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
// Import the utility functionality.
import jobs.generation.Utilities;
def project = GithubProject
def branch = GithubBranchName
def platformList = ['Linux', 'Windows_NT']
platformList.each { platform ->
if (platform == 'Linux') {
[true, false].each { isPR ->
def configuration = 'Release'
def osUsedForMachineAffinity = 'Ubuntu16.04';
def buildCommand = "./build.sh --configuration ${configuration} --targets Default"
def newJob = job(Utilities.getFullJobName(project, platform, isPR)) {
steps {
shell(buildCommand)
}
}
Utilities.setMachineAffinity(newJob, osUsedForMachineAffinity, 'latest-or-auto')
Utilities.standardJobSetup(newJob, project, isPR, "*/${branch}")
if (!isPR) {
Utilities.addGithubPushTrigger(newJob)
}
else {
Utilities.addGithubPRTriggerForBranch(newJob, branch, "${osUsedForMachineAffinity} ${configuration} Build")
}
}
}
else if (platform == 'Windows_NT') {
[true, false].each { isPR ->
['bvt', 'functional'].each { testCategory ->
def newJobName = "${testCategory}"
def testScript = "Test.cmd";
if (testCategory == 'functional') { testScript = "TestAll.cmd" }
def newJob = job(Utilities.getFullJobName(project, newJobName, isPR)) {
steps {
batchFile("SET BuildConfiguration=Release&&set VersionSuffix=ci-%BUILD_ID%&& call Build.cmd && SET OrleansDataConnectionString= && ${testScript}")
}
}
// need to use a machine that has .NET 4.6.2 installed in the system for now.
Utilities.setMachineAffinity(newJob, 'Windows_NT', 'latest-or-auto')
Utilities.standardJobSetup(newJob, project, isPR, "*/${branch}")
Utilities.addXUnitDotNETResults(newJob, '**/xUnit-Results*.xml')
// Archive only on commit builds.
if (!isPR) {
if (testCategory == 'bvt') {
// no reason to archive for every kind of test run
Utilities.addArchival(newJob, '**/Binaries/**')
}
Utilities.addGithubPushTrigger(newJob)
}
else {
Utilities.addGithubPRTriggerForBranch(newJob, branch, newJobName)
}
// args: archive *.binlog, don't exclude anything, don't fail if there are no files, archive in case of failure too
Utilities.addArchival(newJob, '*.binlog', '', true, false)
}
}
}
}