2021-10-25 14:59:16 +02:00
|
|
|
pipeline {
|
|
|
|
agent any
|
2021-10-26 20:30:22 +02:00
|
|
|
environment {
|
2022-01-28 13:33:06 +01:00
|
|
|
DOCK_FILE_DIR = 'automation'
|
2022-01-26 12:28:30 +01:00
|
|
|
BUILDDIR = 'build-tests'
|
2021-10-26 20:30:22 +02:00
|
|
|
}
|
2021-10-25 14:59:16 +02:00
|
|
|
stages {
|
2022-01-28 13:33:06 +01:00
|
|
|
stage('Create Docker') {
|
|
|
|
agent {
|
|
|
|
dockerfile {
|
2022-01-28 14:10:24 +01:00
|
|
|
dir DOCK_FILE_DIR
|
2022-01-28 13:33:06 +01:00
|
|
|
additionalBuildArgs '--no-cache'
|
2022-01-28 13:36:43 +01:00
|
|
|
reuseNode true
|
2022-01-28 13:33:06 +01:00
|
|
|
}
|
|
|
|
}
|
2022-01-28 13:46:05 +01:00
|
|
|
// Does not work, but maybe not necessary anyway..
|
|
|
|
//when {
|
|
|
|
// anyOf {
|
|
|
|
// changeset "${DOCK_FILE_DIR}/Dockerfile";
|
|
|
|
// changelog 'cleanDocker'
|
|
|
|
// }
|
|
|
|
//}
|
2022-01-28 13:36:43 +01:00
|
|
|
steps {
|
|
|
|
sh 'rm -rf $BUILDDIR'
|
|
|
|
}
|
2021-10-26 20:58:34 +02:00
|
|
|
}
|
2022-01-26 15:30:01 +01:00
|
|
|
stage('Clean') {
|
2022-01-27 11:30:33 +01:00
|
|
|
agent {
|
2022-01-28 13:33:06 +01:00
|
|
|
dockerfile {
|
2022-01-28 14:10:24 +01:00
|
|
|
dir DOCK_FILE_DIR
|
2022-01-27 11:30:33 +01:00
|
|
|
reuseNode true
|
|
|
|
}
|
|
|
|
}
|
2022-01-26 15:30:01 +01:00
|
|
|
when {
|
|
|
|
anyOf {
|
|
|
|
changelog 'cleanCI'
|
|
|
|
changeset '*.cmake'
|
|
|
|
changeset 'CMakeLists.txt'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
steps {
|
|
|
|
sh 'rm -rf $BUILDDIR'
|
|
|
|
}
|
|
|
|
}
|
2021-10-26 20:58:34 +02:00
|
|
|
stage('Configure') {
|
|
|
|
agent {
|
2022-01-28 13:33:06 +01:00
|
|
|
dockerfile {
|
2022-01-28 14:10:24 +01:00
|
|
|
dir DOCK_FILE_DIR
|
2021-10-26 20:58:34 +02:00
|
|
|
reuseNode true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
steps {
|
2021-10-26 20:53:08 +02:00
|
|
|
dir(BUILDDIR) {
|
2021-10-26 20:30:22 +02:00
|
|
|
sh 'cmake -DFSFW_OSAL=host -DFSFW_BUILD_UNITTESTS=ON ..'
|
|
|
|
}
|
2021-10-25 14:59:16 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('Build') {
|
|
|
|
agent {
|
2022-01-28 13:33:06 +01:00
|
|
|
dockerfile {
|
2022-01-28 14:10:24 +01:00
|
|
|
dir DOCK_FILE_DIR
|
2021-10-25 14:59:16 +02:00
|
|
|
reuseNode true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
steps {
|
2021-10-26 20:47:53 +02:00
|
|
|
dir(BUILDDIR) {
|
2021-10-25 14:59:16 +02:00
|
|
|
sh 'cmake --build . -j'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('Unittests') {
|
|
|
|
agent {
|
2022-01-28 13:33:06 +01:00
|
|
|
dockerfile {
|
2022-01-28 14:10:24 +01:00
|
|
|
dir DOCK_FILE_DIR
|
2021-10-25 14:59:16 +02:00
|
|
|
reuseNode true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
steps {
|
2021-10-26 20:47:53 +02:00
|
|
|
dir(BUILDDIR) {
|
2021-10-25 14:59:16 +02:00
|
|
|
sh 'cmake --build . -- fsfw-tests_coverage -j'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-10-27 21:32:40 +02:00
|
|
|
stage('Valgrind') {
|
|
|
|
agent {
|
2022-01-28 13:33:06 +01:00
|
|
|
dockerfile {
|
2022-01-28 14:10:24 +01:00
|
|
|
dir DOCK_FILE_DIR
|
2021-10-27 21:32:40 +02:00
|
|
|
reuseNode true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
steps {
|
|
|
|
dir(BUILDDIR) {
|
|
|
|
sh 'valgrind --leak-check=full --error-exitcode=1 ./fsfw-tests'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-10-25 14:59:16 +02:00
|
|
|
}
|
|
|
|
}
|