fsfw/automation/Jenkinsfile
2022-01-28 13:33:06 +01:00

94 lines
2.3 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'
}
}
when {
anyOf {
changeset "$DOCK_FILE_DIR/Dockerfile";
changelog 'cleanDocker'
}
}
}
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'
}
}
}
}
}