-
Notifications
You must be signed in to change notification settings - Fork 172
/
Copy pathstaticlibrary.groovy
120 lines (96 loc) · 3.55 KB
/
staticlibrary.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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#!/usr/bin/env groovy
// This shared library is available at https://github.com/ROCmSoftwarePlatform/rocJENKINS/
@Library('rocJenkins@pong') _
// This is file for AMD Continuous Integration use.
// If you are interested in running your own Jenkins, please raise a github issue for assistance.
import com.amd.project.*
import com.amd.docker.*
import java.nio.file.Path
def runCI =
{
nodeDetails, jobName->
def settings = [formatCheck: false,
addressSanitizer: false,
gfilter: "*quick*:*pre_checkin*"]
def prj = new rocProject('rocBLAS', 'StaticLibrary')
// customize for project
prj.paths.build_command = './install.sh -c --static'
prj.defaults.ccache = false
prj.timeout.compile = 480
// Define test architectures, optional rocm version argument is available
def nodes = new dockerNodes(nodeDetails, jobName, prj)
def compileCommand =
{
platform, project->
commonGroovy = load "${project.paths.project_src_prefix}/.jenkins/common.groovy"
commonGroovy.runCompileCommand(platform, project, jobName, settings)
}
def testCommand =
{
platform, project->
def testFilter = ""
if (env.BRANCH_NAME ==~ /PR-\d+/)
{
pullRequest.labels.each
{
if (it == "TestTensileOnly")
{
testFilter += "*blas3_tensile/quick*:*blas3_tensile/pre_checkin*:"
}
else if(it == "TestLevel3Only")
{
testFilter += "*blas3/quick*:*blas3/pre_checkin*:"
}
else if(it == "TestLevel2Only")
{
testFilter += "*blas2/quick*:*blas2/pre_checkin*:"
}
else if(it == "TestLevel1Only")
{
testFilter += "*blas1*quick*:*blas1*pre_checkin*:"
}
}
}
if (testFilter.length() > 0)
{
// The below command chops the final character ':' in testFilter and transfers the string to settings.gfilter.
settings.gfilter = testFilter.substring(0, testFilter.length() - 1);
}
commonGroovy.runTestCommand(platform, project, settings)
}
def packageCommand =
{
platform, project->
commonGroovy.runPackageCommand(platform, project)
}
buildProject(prj, settings.formatCheck, nodes.dockerArray, compileCommand, testCommand, packageCommand)
}
ci: {
String urlJobName = auxiliary.getTopJobName(env.BUILD_URL)
def propertyList = ["compute-rocm-dkms-no-npi-hipclang":[pipelineTriggers([cron('0 1 * * 6')])]]
propertyList = auxiliary.appendPropertyList(propertyList)
def jobNameList = ["compute-rocm-dkms-no-npi-hipclang":([ubuntu18:['gfx900']])]
jobNameList = auxiliary.appendJobNameList(jobNameList, 'rocBLAS')
propertyList.each
{
jobName, property->
if (urlJobName == jobName)
properties(auxiliary.addCommonProperties(property))
}
jobNameList.each
{
jobName, nodeDetails->
if (urlJobName == jobName)
stage(jobName) {
runCI(nodeDetails, jobName)
}
}
// For url job names that are not listed by the jobNameList i.e. compute-rocm-dkms-no-npi-1901
if(!jobNameList.keySet().contains(urlJobName))
{
properties(auxiliary.addCommonProperties([pipelineTriggers([cron('0 1 * * *')])]))
stage(urlJobName) {
runCI([ubuntu18:['gfx900']], urlJobName)
}
}
}