98 lines
2.4 KiB
Groovy
98 lines
2.4 KiB
Groovy
pipeline {
|
|
agent any
|
|
environment {
|
|
DOCK_FILE_DIR = 'automation'
|
|
BUILDDIR = 'build-tests'
|
|
}
|
|
stages {
|
|
stage('Create Docker') {
|
|
agent {
|
|
dockerfile {
|
|
dir '$DOCK_FILE_DIR'
|
|
additionalBuildArgs '--no-cache'
|
|
reuseNode true
|
|
}
|
|
}
|
|
when {
|
|
anyOf {
|
|
changeset "${DOCK_FILE_DIR}/Dockerfile";
|
|
changelog 'cleanDocker'
|
|
}
|
|
}
|
|
steps {
|
|
sh 'rm -rf $BUILDDIR'
|
|
}
|
|
}
|
|
stage('Clean') {
|
|
agent {
|
|
dockerfile {
|
|
dir '$DOCK_FILE_DIR'
|
|
reuseNode true
|
|
}
|
|
}
|
|
when {
|
|
anyOf {
|
|
changelog 'cleanCI'
|
|
changeset '*.cmake'
|
|
changeset 'CMakeLists.txt'
|
|
}
|
|
}
|
|
steps {
|
|
sh 'rm -rf $BUILDDIR'
|
|
}
|
|
}
|
|
stage('Configure') {
|
|
agent {
|
|
dockerfile {
|
|
dir '$DOCK_FILE_DIR'
|
|
reuseNode true
|
|
}
|
|
}
|
|
steps {
|
|
dir(BUILDDIR) {
|
|
sh 'cmake -DFSFW_OSAL=host -DFSFW_BUILD_UNITTESTS=ON ..'
|
|
}
|
|
}
|
|
}
|
|
stage('Build') {
|
|
agent {
|
|
dockerfile {
|
|
dir '$DOCK_FILE_DIR'
|
|
reuseNode true
|
|
}
|
|
}
|
|
steps {
|
|
dir(BUILDDIR) {
|
|
sh 'cmake --build . -j'
|
|
}
|
|
}
|
|
}
|
|
stage('Unittests') {
|
|
agent {
|
|
dockerfile {
|
|
dir '$DOCK_FILE_DIR'
|
|
reuseNode true
|
|
}
|
|
}
|
|
steps {
|
|
dir(BUILDDIR) {
|
|
sh 'cmake --build . -- fsfw-tests_coverage -j'
|
|
}
|
|
}
|
|
}
|
|
stage('Valgrind') {
|
|
agent {
|
|
dockerfile {
|
|
dir '$DOCK_FILE_DIR'
|
|
reuseNode true
|
|
}
|
|
}
|
|
steps {
|
|
dir(BUILDDIR) {
|
|
sh 'valgrind --leak-check=full --error-exitcode=1 ./fsfw-tests'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|