Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
3ccebf92
Commit
3ccebf92
authored
Jul 21, 2018
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Follow Groovy coding style and archive builds
parent
da9956ac
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
208 additions
and
168 deletions
+208
-168
Jenkinsfile
Jenkinsfile
+208
-168
No files found.
Jenkinsfile
View file @
3ccebf92
#
!
/usr/
bin
/
env
groovy
#
!
/usr/
bin
/
env
groovy
// List of CMake arguments used by most builds.
// Default CMake flags for most builds (except coverage).
defaultCmakeArgs
=
'-DCAF_MORE_WARNINGS:BOOL=yes'
\
defaultBuildFlags
=
[
+
' -DCAF_ENABLE_RUNTIME_CHECKS:BOOL=yes'
\
'CAF_MORE_WARNINGS:BOOL=yes'
,
+
' -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl'
\
'CAF_ENABLE_RUNTIME_CHECKS:BOOL=yes'
,
+
' -DOPENSSL_INCLUDE_DIR=/usr/local/opt/openssl/include'
\
'CAF_NO_OPENCL:BOOL=yes'
,
'OPENSSL_ROOT_DIR=/usr/local/opt/openssl'
,
'OPENSSL_INCLUDE_DIR=/usr/local/opt/openssl/include'
,
]
// CMake flags for release builds.
releaseBuildFlags
=
defaultBuildFlags
+
[
]
// CMake flags for debug builds.
debugBuildFlags
=
defaultBuildFlags
+
[
'CAF_ENABLE_RUNTIME_CHECKS:BOOL=yes'
,
'CAF_ENABLE_ADDRESS_SANITIZER:BOOL=yes'
,
'CAF_LOG_LEVEL:STRING=4'
,
]
// Our build matrix. The keys are the operating system labels and the values
// Our build matrix. The keys are the operating system labels and the values
// are lists of tool labels.
// are lists of tool labels.
buildMatrix
=
[
buildMatrix
=
[
// Debug builds with ASAN + logging for various OS/compiler combinations.
// Debug builds with ASAN + logging for various OS/compiler combinations.
[
'uni
x'
,
[
[
'Linu
x'
,
[
builds:
[
'debug'
],
builds:
[
'debug'
],
tools:
[
'gcc4.8'
,
'gcc4.9'
,
'gcc5'
,
'gcc6'
,
'gcc7'
,
'gcc8'
,
'clang'
],
tools:
[
'gcc4.8'
,
'gcc4.9'
,
'gcc5'
,
'gcc6'
,
'gcc7'
,
'gcc8'
],
cmakeArgs:
defaultCmakeArgs
cmakeArgs:
debugBuildFlags
,
+
' -DCAF_LOG_LEVEL:STRING=4'
]],
+
' -DCAF_ENABLE_ADDRESS_SANITIZER:BOOL=yes'
,
[
'macOS'
,
[
builds:
[
'debug'
],
tools:
[
'clang'
],
cmakeArgs:
debugBuildFlags
,
]],
]],
// One release build per supported OS. FreeBSD and Windows have the least
// One release build per supported OS. FreeBSD and Windows have the least
// testing outside Jenkins, so we also explicitly schedule debug builds.
// testing outside Jenkins, so we also explicitly schedule debug builds.
[
'Linux'
,
[
[
'Linux'
,
[
builds:
[
'release'
],
builds:
[
'release'
],
tools:
[
'gcc'
,
'clang'
],
tools:
[
'gcc'
,
'clang'
],
cmakeArgs:
defaultCmakeAr
gs
,
cmakeArgs:
releaseBuildFla
gs
,
]],
]],
[
'macOS'
,
[
[
'macOS'
,
[
builds:
[
'release'
],
builds:
[
'release'
],
tools:
[
'clang'
],
tools:
[
'clang'
],
cmakeArgs:
defaultCmakeAr
gs
,
cmakeArgs:
releaseBuildFla
gs
,
]],
]],
[
'FreeBSD'
,
[
[
'FreeBSD'
,
[
builds:
[
'debug'
],
// no release build for now, because it takes 1h
builds:
[
'debug'
],
// no release build for now, because it takes 1h
tools:
[
'clang'
],
tools:
[
'clang'
],
cmakeArgs:
defaultCmakeAr
gs
,
cmakeArgs:
debugBuildFla
gs
,
]],
]],
[
'Windows'
,
[
[
'Windows'
,
[
builds:
[
'debug'
,
'release'
],
builds:
[
'debug'
,
'release'
],
tools:
[
'msvc'
],
tools:
[
'msvc'
],
cmakeArgs:
'-DCAF_BUILD_STATIC_ONLY:BOOL=yes'
cmakeArgs:
[
+
' -DCAF_ENABLE_RUNTIME_CHECKS:BOOL=yes'
'CAF_BUILD_STATIC_ONLY:BOOL=yes'
,
+
' -DCAF_NO_OPENCL:BOOL=yes'
,
'CAF_ENABLE_RUNTIME_CHECKS:BOOL=yes'
,
'CAF_NO_OPENCL:BOOL=yes'
,
],
]],
]],
// One Additional build for coverage reports.
// One Additional build for coverage reports.
[
'uni
x'
,
[
[
'Linu
x'
,
[
builds:
[
'debug'
],
builds:
[
'debug'
],
tools:
[
'
gcovr'
],
tools:
[
'gcc8 &&
gcovr'
],
extraSteps:
[
'coverageReport'
],
extraSteps:
[
'coverageReport'
],
cmakeArgs:
'-DCAF_ENABLE_GCOV:BOOL=yes '
cmakeArgs:
[
+
' -DCAF_NO_EXCEPTIONS:BOOL=yes '
'CAF_ENABLE_GCOV:BOOL=yes'
,
+
' -DCAF_FORCE_NO_EXCEPTIONS:BOOL=yes'
,
'CAF_NO_EXCEPTIONS:BOOL=yes'
,
'CAF_FORCE_NO_EXCEPTIONS:BOOL=yes'
,
],
]],
]],
]
]
...
@@ -80,15 +101,20 @@ def coverageReport() {
...
@@ -80,15 +101,20 @@ def coverageReport() {
}
}
}
}
def
cmakeSteps
(
buildType
,
cmakeArgs
)
{
def
cmakeSteps
(
buildType
,
cmakeArgs
,
installDir
)
{
def
absInstallDir
=
pwd
()
+
'/'
+
installDir
dir
(
'caf-sources'
)
{
// Configure and build.
// Configure and build.
cmakeBuild
([
cmakeBuild
([
buildDir:
'build'
,
buildDir:
'build'
,
buildType:
buildType
,
buildType:
buildType
,
cmakeArgs:
cmakeArgs
,
cmakeArgs:
"-DCMAKE_INSTALL_PREFIX=\"$absInstallDir\" "
+
cmakeArgs
,
installation:
'cmake in search path'
,
installation:
'cmake in search path'
,
sourceDir:
'.'
,
sourceDir:
'.'
,
steps:
[[
withCmake:
true
]],
steps:
[[
args:
'--target install'
,
withCmake:
true
,
]],
])
])
// Run unit tests.
// Run unit tests.
ctest
([
ctest
([
...
@@ -96,29 +122,42 @@ def cmakeSteps(buildType, cmakeArgs) {
...
@@ -96,29 +122,42 @@ def cmakeSteps(buildType, cmakeArgs) {
installation:
'cmake in search path'
,
installation:
'cmake in search path'
,
workingDir:
'build'
,
workingDir:
'build'
,
])
])
}
zip
([
archive:
true
,
dir:
installDir
,
zipFile:
"${installDir}.zip"
,
])
}
}
def
buildSteps
(
buildType
,
cmakeArgs
)
{
// Builds `name` with CMake and runs the unit tests.
def
buildSteps
(
buildType
,
cmakeArgs
,
installDir
)
{
echo
"build stage: $STAGE_NAME"
echo
"build stage: $STAGE_NAME"
deleteDir
()
deleteDir
()
dir
(
installDir
)
{
// Create directory.
}
unstash
(
'caf-sources'
)
unstash
(
'caf-sources'
)
dir
(
'caf-sources'
)
{
if
(
STAGE_NAME
.
contains
(
'Windows'
))
{
if
(
STAGE_NAME
.
contains
(
'Windows'
))
{
echo
"Windows build on $NODE_NAME"
echo
"Windows build on $NODE_NAME"
withEnv
([
'PATH=C:\\Windows\\System32;C:\\Program Files\\CMake\\bin;C:\\Program Files\\Git\\cmd;C:\\Program Files\\Git\\bin'
])
{
withEnv
([
'PATH=C:\\Windows\\System32;C:\\Program Files\\CMake\\bin;C:\\Program Files\\Git\\cmd;C:\\Program Files\\Git\\bin'
])
{
cmakeSteps
(
buildType
,
cmakeArgs
)
cmakeSteps
(
buildType
,
cmakeArgs
,
installDir
)
}
}
}
else
{
}
else
{
echo
"Unix build on $NODE_NAME"
echo
"Unix build on $NODE_NAME"
def
leakCheck
=
STAGE_NAME
.
contains
(
"Linux"
)
&&
!
STAGE_NAME
.
contains
(
"clang"
)
def
leakCheck
=
STAGE_NAME
.
contains
(
"Linux"
)
&&
!
STAGE_NAME
.
contains
(
"clang"
)
withEnv
([
"label_exp="
+
STAGE_NAME
.
toLowerCase
(),
withEnv
([
"label_exp="
+
STAGE_NAME
.
toLowerCase
(),
"ASAN_OPTIONS=detect_leaks="
+
(
leakCheck
?
1
:
0
)])
{
"ASAN_OPTIONS=detect_leaks="
+
(
leakCheck
?
1
:
0
)])
{
cmakeSteps
(
buildType
,
cmakeArgs
)
cmakeSteps
(
buildType
,
cmakeArgs
,
installDir
)
}
}
}
}
}
}
}
// Concatenates CMake flags into a single string.
def
makeFlags
(
xs
)
{
xs
.
collect
{
x
->
'-D'
+
x
}.
join
(
' '
)
}
// Builds a stage for given builds. Results in a parallel stage `if builds.size() > 1`.
// Builds a stage for given builds. Results in a parallel stage `if builds.size() > 1`.
def
makeBuildStages
(
matrixIndex
,
builds
,
lblExpr
,
settings
)
{
def
makeBuildStages
(
matrixIndex
,
builds
,
lblExpr
,
settings
)
{
builds
.
collectEntries
{
buildType
->
builds
.
collectEntries
{
buildType
->
...
@@ -129,8 +168,9 @@ def makeBuildStages(matrixIndex, builds, lblExpr, settings) {
...
@@ -129,8 +168,9 @@ def makeBuildStages(matrixIndex, builds, lblExpr, settings) {
node
(
lblExpr
)
{
node
(
lblExpr
)
{
stage
(
id
)
{
stage
(
id
)
{
try
{
try
{
def
installDir
=
"$lblExpr && $buildType"
withEnv
(
buildEnvironments
[
lblExpr
]
?:
[])
{
withEnv
(
buildEnvironments
[
lblExpr
]
?:
[])
{
buildSteps
(
buildType
,
settings
[
'cmakeArgs'
]
?:
''
)
buildSteps
(
buildType
,
makeFlags
(
settings
[
'cmakeArgs'
]),
installDir
)
(
settings
[
'extraSteps'
]
?:
[]).
each
{
fun
->
"$fun"
()
}
(
settings
[
'extraSteps'
]
?:
[]).
each
{
fun
->
"$fun"
()
}
}
}
}
finally
{
}
finally
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment