forked from Ultimaker/CuraEngine
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Jenkinsfile
57 lines (52 loc) · 2.29 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
parallel_nodes(["linux && cura", "windows && cura"]) {
timeout(time: 2, unit: "HOURS") {
stage('Prepare') {
step([$class: 'WsCleanup'])
checkout scm
}
catchError {
dir('build') {
stage('Build') {
def branch = env.BRANCH_NAME
if(!fileExists("${env.CURA_ENVIRONMENT_PATH}/${branch}")) {
branch = "master"
}
extra_cmake_args = ""
if(!isUnix()) {
extra_cmake_args = "-DArcus_DIR=\"${env.CURA_ENVIRONMENT_PATH}/${branch}/lib-mingw/cmake/Arcus\" -DGTEST_LIBRARY=\"${env.CURA_ENVIRONMENT_PATH}/${branch}/lib-mingw/libgtest.a\" -DGTEST_MAIN_LIBRARY=\"${env.CURA_ENVIRONMENT_PATH}/${branch}/lib-mingw/libgtest_main.a\" -DGMOCK_LIBRARY=\"${env.CURA_ENVIRONMENT_PATH}/${branch}/lib-mingw/libgmock.a\" -DGMOCK_MAIN_LIBRARY=\"${env.CURA_ENVIRONMENT_PATH}/${branch}/lib-mingw/libgmock_main.a\""
}
cmake '..', "-DCMAKE_PREFIX_PATH=\"${env.CURA_ENVIRONMENT_PATH}/${branch}\" -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=ON ${extra_cmake_args}"
make('')
}
// Try and run the unit tests. If this stage fails, we consider the build to be "unstable".
stage('Unit Test') {
if (isUnix())
{
// For Linux
try {
sh 'make CTEST_OUTPUT_ON_FAILURE=TRUE test'
} catch(e)
{
currentBuild.result = "UNSTABLE"
}
}
else
{
// For Windows
try
{
// This also does code style checks.
bat 'ctest -V'
} catch(e)
{
currentBuild.result = "UNSTABLE"
}
}
}
}
}
stage('Finalize') {
notify_build_result(env.CURA_EMAIL_RECIPIENTS, '#cura-dev', ['master'])
}
}
}