fsfw/automation/Jenkinsfile

91 lines
2.2 KiB
Groovy

pipeline {
agent any
environment {
DOCKER_TAG = 'fsfw-build'
BUILDDIR = 'build-tests'
}
stages {
stage('Build Container') {
when {
anyOf {
changeset "automation/Dockerfile";
changelog 'cleanDocker'
}
}
steps {
sh 'docker build -t $DOCKER_TAG - < automation/Dockerfile'
}
}
stage('Clean') {
agent {
docker {
image '$DOCKER_TAG'
reuseNode true
}
}
when {
anyOf {
changelog 'cleanCI'
changeset '*.cmake'
changeset 'CMakeLists.txt'
}
}
steps {
sh 'rm -rf $BUILDDIR'
}
}
stage('Configure') {
agent {
docker {
image '$DOCKER_TAG'
reuseNode true
}
}
steps {
dir(BUILDDIR) {
sh 'cmake -DFSFW_OSAL=host -DFSFW_BUILD_UNITTESTS=ON ..'
}
}
}
stage('Build') {
agent {
docker {
image '$DOCKER_TAG'
reuseNode true
}
}
steps {
dir(BUILDDIR) {
sh 'cmake --build . -j'
}
}
}
stage('Unittests') {
agent {
docker {
image '$DOCKER_TAG'
reuseNode true
}
}
steps {
dir(BUILDDIR) {
sh 'cmake --build . -- fsfw-tests_coverage -j'
}
}
}
stage('Valgrind') {
agent {
docker {
image '$DOCKER_TAG'
reuseNode true
}
}
steps {
dir(BUILDDIR) {
sh 'valgrind --leak-check=full --error-exitcode=1 ./fsfw-tests'
}
}
}
}
}