-
Notifications
You must be signed in to change notification settings - Fork 279
/
Jenkinsfile
70 lines (59 loc) · 2.27 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
#!groovy
node {
checkout scm
def image = docker.build("cmake-build:${env.BUILD_ID}")
def builds = [:]
def output = image.inside {
sh returnStdout: true, script: "cmake -LA ./firmware | grep 'VEHICLE_VALUES' | cut -d'=' -f 2"
}
def platforms = output.trim().tokenize(';')
for(int j=0; j<platforms.size(); j++) {
def platform_idx = j
def platform = platforms[platform_idx]
builds[platform] = {
node {
checkout scm
image = docker.build("cmake-build:${env.BUILD_ID}")
stage("Build ${platform}") {
image.inside {
sh "cd firmware && \
rm -rf build_${platform} && \
mkdir build_${platform} && \
cd build_${platform} && \
cmake -DVEHICLE=${platform} -DCMAKE_BUILD_TYPE=Release .. && \
make"
echo "${platform}: Build Complete!"
}
}
stage("Test ${platform} unit tests") {
image.inside {
sh "cd firmware && \
rm -rf build_${platform}_tests && \
mkdir build_${platform}_tests && \
cd build_${platform}_tests && \
cmake -DVEHICLE=${platform} \
-DTESTS=ON \
-DPORT_SUFFIX=${EXECUTOR_NUMBER}${platform_idx} \
-DCMAKE_BUILD_TYPE=Release \
.. && \
make run-unit-tests"
echo "${platform}: Unit Tests Complete!"
}
}
stage("Test ${platform} property-based tests") {
image.inside("--user root:root") {
sh "cd firmware/build_${platform}_tests && \
make run-property-tests"
echo "${platform}: Property-Based Tests Complete!"
}
}
}
}
}
try {
parallel builds
}
finally {
deleteDir()
}
}