-
Notifications
You must be signed in to change notification settings - Fork 13
/
Jenkinsfile
77 lines (75 loc) · 3.13 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
70
71
72
73
74
75
76
77
// Copyright (c) Open Enclave SDK contributors.
// Licensed under the MIT License.
def cmakeBuildoeedger8r(String BUILD_CONFIG, String COMPILER) {
/* Build oeedger8r based on build config, compiler and platform */
cleanWs()
checkout([$class: 'GitSCM',
branches: [[name: BRANCH_NAME]],
extensions: [],
userRemoteConfigs: [[url: 'https://github.com/openenclave/oeedger8r-cpp']]])
dir ('build') {
if (isUnix()) {
sh """
echo COMPILER IS ${COMPILER}
"""
switch(COMPILER) {
case COMPILER.contains("clang-"):
compiler_version = COMPILER.split('-').get(1)
c_compiler = "clang-${compiler_version}"
cpp_compiler = "clang++-${compiler_version}"
break
case "gcc":
c_compiler = "gcc"
cpp_compiler = "g++"
break
default:
// This is needed for backwards compatibility with the old
// implementation of the method.
c_compiler = "clang-10"
cpp_compiler = "clang++-10"
}
withEnv(["CC=${c_compiler}","CXX=${cpp_compiler}"]) {
sh """
cmake .. -G Ninja -DCMAKE_BUILD_TYPE=${BUILD_CONFIG} -Wdev
ninja -v
ctest --output-on-failure --timeout
"""
}
} else {
bat (
returnStdout: false,
returnStatus: false,
script: """
call vcvars64.bat x64
setlocal EnableDelayedExpansion
cmake.exe .. -G Ninja -DCMAKE_BUILD_TYPE=${BUILD_CONFIG} -Wdev || exit !ERRORLEVEL!
ninja -v -j 4 || exit !ERRORLEVEL!
ctest.exe -V --output-on-failure || exit !ERRORLEVEL!
"""
)
}
}
}
pipeline {
options {
timeout(time: 30, unit: 'MINUTES')
}
agent any
stages {
stage('Parallel tests') {
parallel {
stage('Ubuntu 20.04 RelWithDebInfo') { steps { node("nonSGX-ubuntu-2004") { cmakeBuildoeedger8r("RelWithDebInfo", "clang-10")}}}
stage('Ubuntu 20.04 Debug') { steps { node("nonSGX-ubuntu-2004") { cmakeBuildoeedger8r("Debug", "clang-10")}}}
stage('Ubuntu 18.04 RelWithDebInfo') { steps { node("nonSGX-ubuntu-1804") { cmakeBuildoeedger8r("RelWithDebInfo", "clang-10")}}}
stage('Ubuntu 18.04 Debug') { steps { node("nonSGX-ubuntu-1804") { cmakeBuildoeedger8r("Debug", "clang-10")}}}
stage('WS 2019 RelWithDebInfo') { steps { node("nonSGX-Windows-2019") { cmakeBuildoeedger8r("RelWithDebInfo", "clang-10")}}}
stage('WS 2019 Debug') { steps { node("nonSGX-Windows-2019") { cmakeBuildoeedger8r("Debug", "clang-10")}}}
}
}
}
post ('Clean Up') {
always{
cleanWs()
}
}
}