Skip to content

Commit e37efd4

Browse files
authored
Add CI jobs for extra CMake related builds. (#8932)
- A new job is added that builds OpenModelica on Windows with OMDev and gcc using CMake. - A new job is added that builds OpenModelica on Ubuntu with gcc and then runs the testsuite with it. For this job a normal (autoconf) build is also performed to build some things that the CMake build does not build yet, e.g. OMSI runtimes. The relevant files from the autoconf build are then stashed and used together with the stash from the CMake build. - These jobs are planned to be run nightly and are NOT part of the commit based CI They can reached at https://test.openmodelica.org/jenkins/job/periodic/job/CMake_builds/
1 parent 78818a8 commit e37efd4

File tree

3 files changed

+195
-3
lines changed

3 files changed

+195
-3
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
def common
2+
pipeline {
3+
agent none
4+
options {
5+
buildDiscarder(logRotator(numToKeepStr: "5", artifactNumToKeepStr: "2"))
6+
}
7+
stages {
8+
stage('Environment') {
9+
agent {
10+
label '!windows'
11+
}
12+
steps {
13+
script {
14+
if (changeRequest()) {
15+
def buildNumber = env.BUILD_NUMBER as int
16+
if (buildNumber > 1) milestone(buildNumber - 1)
17+
milestone(buildNumber)
18+
}
19+
common = load("${env.workspace}/.CI/common.groovy")
20+
}
21+
}
22+
}
23+
stage('build') {
24+
parallel {
25+
stage('cmake-OMDev-gcc') {
26+
agent {
27+
node {
28+
label 'windows'
29+
}
30+
}
31+
environment {
32+
RUNTESTDB = '/c/dev/'
33+
LIBRARIES = '/c/dev/jenkins-cache/omlibrary/'
34+
}
35+
steps {
36+
script {
37+
withEnv (["PATH=C:\\OMDev\\tools\\msys\\usr\\bin;C:\\Program Files\\TortoiseSVN\\bin;c:\\bin\\jdk\\bin;c:\\bin\\nsis\\;${env.PATH};c:\\bin\\git\\bin;"]) {
38+
bat "echo PATH: %PATH%"
39+
common.buildOMC_CMake('-DCMAKE_BUILD_TYPE=Release -DOM_USE_CCACHE=OFF -DCMAKE_INSTALL_PREFIX=build -G "MSYS Makefiles"')
40+
}
41+
}
42+
}
43+
}
44+
}
45+
}
46+
}
47+
}
Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
def common
2+
pipeline {
3+
agent none
4+
options {
5+
buildDiscarder(logRotator(numToKeepStr: "5", artifactNumToKeepStr: "2"))
6+
}
7+
stages {
8+
stage('Environment') {
9+
agent {
10+
label '!windows'
11+
}
12+
steps {
13+
script {
14+
if (changeRequest()) {
15+
def buildNumber = env.BUILD_NUMBER as int
16+
if (buildNumber > 1) milestone(buildNumber - 1)
17+
milestone(buildNumber)
18+
}
19+
common = load("${env.workspace}/.CI/common.groovy")
20+
}
21+
}
22+
}
23+
stage('build') {
24+
parallel {
25+
stage('autoconf-bionic-gcc') {
26+
agent {
27+
docker {
28+
image 'docker.openmodelica.org/build-deps:v1.16.3'
29+
label 'linux'
30+
alwaysPull true
31+
args "--mount type=volume,source=omlibrary-cache,target=/cache/omlibrary " +
32+
"-v /var/lib/jenkins/gitcache:/var/lib/jenkins/gitcache"
33+
}
34+
}
35+
steps {
36+
script { common.buildOMC('gcc', 'g++', '', true, false) }
37+
stash name: 'omc-gcc', includes: 'build/bin/OMCppOSUSimulation, build/include/omc/omsi/**, build/include/omc/omsic/**, build/lib/x86_64-linux-gnu/omc/omsi/**, build/lib/x86_64-linux-gnu/omc/omsicpp/**, **/config.status'
38+
}
39+
}
40+
stage('cmake-bionic-gcc') {
41+
agent {
42+
dockerfile {
43+
additionalBuildArgs '--pull'
44+
dir '.CI/cache-bionic-cmake-3.17.2'
45+
label 'linux'
46+
alwaysPull true
47+
args "--mount type=volume,source=omlibrary-cache,target=/cache/omlibrary " +
48+
"-v /var/lib/jenkins/gitcache:/var/lib/jenkins/gitcache"
49+
}
50+
}
51+
steps {
52+
script {
53+
common.buildOMC_CMake('-DCMAKE_BUILD_TYPE=Release -DOM_USE_CCACHE=OFF -DCMAKE_INSTALL_PREFIX=build -DSUNDIALS_BUILD_SHARED_LIBS=ON', '/opt/cmake-3.17.2/bin/cmake')
54+
sh "build/bin/omc --version"
55+
}
56+
stash name: 'omc-cmake-gcc', includes: 'build/**'
57+
}
58+
}
59+
}
60+
}
61+
62+
stage('tests') {
63+
parallel {
64+
stage('testsuite-cmake-gcc 1/3') {
65+
agent {
66+
dockerfile {
67+
additionalBuildArgs '--pull'
68+
dir '.CI/cache-bionic-cmake-3.17.2'
69+
label 'linux'
70+
args "--mount type=volume,source=runtest-gcc-cache,target=/cache/runtest " +
71+
"--mount type=volume,source=omlibrary-cache,target=/cache/omlibrary " +
72+
"-v /var/lib/jenkins/gitcache:/var/lib/jenkins/gitcache"
73+
}
74+
}
75+
environment {
76+
RUNTESTDB = "/cache/runtest/"
77+
LIBRARIES = "/cache/omlibrary"
78+
}
79+
steps {
80+
script {
81+
common.standardSetup()
82+
unstash 'omc-gcc'
83+
unstash 'omc-cmake-gcc'
84+
common.makeLibsAndCache()
85+
common.partest(1, 3)
86+
}
87+
}
88+
}
89+
}
90+
stage('testsuite-cmake-gcc 2/3') {
91+
agent {
92+
dockerfile {
93+
additionalBuildArgs '--pull'
94+
dir '.CI/cache-bionic-cmake-3.17.2'
95+
label 'linux'
96+
args "--mount type=volume,source=runtest-gcc-cache,target=/cache/runtest " +
97+
"--mount type=volume,source=omlibrary-cache,target=/cache/omlibrary " +
98+
"-v /var/lib/jenkins/gitcache:/var/lib/jenkins/gitcache"
99+
}
100+
}
101+
environment {
102+
RUNTESTDB = "/cache/runtest/"
103+
LIBRARIES = "/cache/omlibrary"
104+
}
105+
steps {
106+
script {
107+
common.standardSetup()
108+
unstash 'omc-gcc'
109+
unstash 'omc-cmake-gcc'
110+
common.makeLibsAndCache()
111+
common.partest(2, 3)
112+
}
113+
}
114+
}
115+
}
116+
stage('testsuite-cmake-gcc 3/3') {
117+
agent {
118+
dockerfile {
119+
additionalBuildArgs '--pull'
120+
dir '.CI/cache-bionic-cmake-3.17.2'
121+
label 'linux'
122+
args "--mount type=volume,source=runtest-gcc-cache,target=/cache/runtest " +
123+
"--mount type=volume,source=omlibrary-cache,target=/cache/omlibrary " +
124+
"-v /var/lib/jenkins/gitcache:/var/lib/jenkins/gitcache"
125+
}
126+
}
127+
environment {
128+
RUNTESTDB = "/cache/runtest/"
129+
LIBRARIES = "/cache/omlibrary"
130+
}
131+
steps {
132+
script {
133+
common.standardSetup()
134+
unstash 'omc-gcc'
135+
unstash 'omc-cmake-gcc'
136+
common.makeLibsAndCache()
137+
common.partest(3, 3)
138+
}
139+
}
140+
}
141+
}
142+
}
143+
}
144+
}

.CI/common.groovy

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -318,11 +318,11 @@ void buildOMC_CMake(cmake_args, cmake_exe='cmake') {
318318
echo export MSYS_WORKSPACE="`cygpath '${WORKSPACE}'`"
319319
echo echo MSYS_WORKSPACE: \${MSYS_WORKSPACE}
320320
echo cd \${MSYS_WORKSPACE}
321-
echo export MAKETHREADS=16
322321
echo set -ex
323322
echo mkdir build_cmake
324-
echo cmake -S ./ -B ./build_cmake ${cmake_args}
325-
echo time cmake --build ./build_cmake --parallel \${MAKETHREADS} --target install
323+
echo ${cmake_exe} --version
324+
echo ${cmake_exe} -S ./ -B ./build_cmake ${cmake_args}
325+
echo time ${cmake_exe} --build ./build_cmake --parallel ${numPhysicalCPU()} --target install
326326
) > buildOMCWindows.sh
327327
328328
set MSYSTEM=MINGW64
@@ -332,6 +332,7 @@ void buildOMC_CMake(cmake_args, cmake_exe='cmake') {
332332
}
333333
else {
334334
sh "mkdir ./build_cmake"
335+
sh "${cmake_exe} --version"
335336
sh "${cmake_exe} -S ./ -B ./build_cmake ${cmake_args}"
336337
sh "${cmake_exe} --build ./build_cmake --parallel ${numPhysicalCPU()} --target install"
337338
sh "${cmake_exe} --build ./build_cmake --parallel ${numPhysicalCPU()} --target testsuite-depends"

0 commit comments

Comments
 (0)