-
Notifications
You must be signed in to change notification settings - Fork 22
/
Jenkinsfile
69 lines (61 loc) · 1.78 KB
/
Jenkinsfile
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
// Switch to Clang to run against clang. A future iteration of the pipeline will run clang+gcc in parallel
def COMPILER_FAMILY = "GCC"
node {
withNotifications("jenkins/${COMPILER_FAMILY}") {
def cmake = tool name: 'Latest', type: 'hudson.plugins.cmake.CmakeTool'
echo "Using CMake from ${cmake}"
def cc = tool "CC-${COMPILER_FAMILY}"
def cxx = tool "CXX-${COMPILER_FAMILY}"
echo "Using CC=${cc}, CXX=${cxx}"
withVirtualenv(pwd() + "/virtualenv") {
sh "python -m pip install --upgrade numpy pytest scipy"
withEnv(["CC=${cc}", "CXX=${cxx}"]) {
stage('Checkout') {
checkout scm
}
cleanDir('build') {
stage('Configure') {
sh "${cmake} ../"
}
stage('Build') {
sh 'make'
}
stage('Test') {
try {
sh "python -m pytest --junitxml=pytests.xml"
} finally {
junit 'pytests.xml'
}
}
}
}
}
}
}
def cleanDir(path, cl) {
if (fileExists(path)) {
dir(path) {
deleteDir()
}
sh "mkdir ${path}"
}
dir(path) {
cl()
}
}
def withNotifications(context, cl) {
githubNotify context: "${context}", account: 'otherlab', credentialsId: 'd411dfdb-4ceb-4d55-845e-46d1d40e40dc', repo: 'geode', status: 'PENDING'
try {
cl()
} catch (e) {
githubNotify context: "${context}", account: 'otherlab', credentialsId: 'd411dfdb-4ceb-4d55-845e-46d1d40e40dc', repo: 'geode', status: 'FAILURE'
throw e
}
githubNotify context: "${context}", account: 'otherlab', credentialsId: 'd411dfdb-4ceb-4d55-845e-46d1d40e40dc', repo: 'geode', status: 'SUCCESS'
}
def withVirtualenv(path, cl) {
sh "virtualenv ${path}"
withEnv(["PATH+VIRTUALENV=${path}/bin"]) {
cl()
}
}