forked from OGRECave/ogre
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
89 lines (78 loc) · 2.58 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
78
79
80
81
82
83
84
85
86
87
88
89
def pull() {
try {
checkout scm: [$class: 'MercurialSCM',
source: 'https://bitbucket.org/sinbad/ogre',
revision: 'default',
clean: false]
} catch(Exception e) {
// mac runner is flaky
}
}
def test_android() {
node("Ubuntu") {
pull()
stage("Android Build") {
env.ANDROID_NDK = pwd()+"/android-ndk-r13b"
env.ANDROID_SDK = "none"
sh "ANDROID=TRUE cmake -P ci-build.cmake"
sh "cmake --build ."
}
}
}
def test_ios() {
node("mac") {
pull()
stage("ios Build") {
sh "IOS=TRUE cmake -P ci-build.cmake"
sh "cmake --build ."
}
}
}
def test_platform(label, isstatic) {
node(label) {
pull()
def type = isstatic == "TRUE" ? "static" : "shared"
stage("${label} (${type}) Build") {
def common = " -DOGRE_BUILD_TESTS=ON -DCMAKE_BUILD_TYPE=Debug -DOGRE_STATIC=${isstatic} ."
if(isUnix()) {
if(label == "mac") {
common += " -G Xcode"
}
sh "cmake -DOGRE_BUILD_DEPENDENCIES=OFF -DCMAKE_CXX_FLAGS=-Werror ${common}"
if(label == "mac") {
sh "cmake --build . -- ONLY_ACTIVE_ARCH=YES"
} else {
sh "cmake --build ."
}
} else {
def cxxflags = '-DGTEST_HAS_TR1_TUPLE=0 -EHsc'
if(isstatic == "FALSE") {
cxxflags += " -WX"
}
bat """cmake -DOGRE_BUILD_COMPONENT_PROPERTY=FALSE -DOGRE_BUILD_RENDERSYSTEM_GL=FALSE -DCMAKE_CXX_FLAGS="${cxxflags}" ${common}"""
bat "cmake --build ."
}
}
if(label == "Ubuntu") {
stage("${label} (${type}) Test") {
sh "xvfb-run -a bin/Test_Ogre"
}
}
}
}
bitbucketStatusNotify ( buildState: 'INPROGRESS' )
try {
parallel (failFast: false,
linux_static: { test_platform("Ubuntu", "TRUE") },
linux_dynamic: { test_platform("Ubuntu", "FALSE") },
android: { test_android() },
mac_dynamic: { test_platform("mac", "FALSE") },
mac_static: { test_platform("mac", "TRUE") },
ios: { test_ios() },
windows_static: { test_platform("windows", "TRUE") },
windows_dynamic: { test_platform("windows", "FALSE") }
)
bitbucketStatusNotify ( buildState: 'SUCCESSFUL' )
} catch(Exception e) {
bitbucketStatusNotify ( buildState: 'FAILED' )
}