Robin Mueller
441b3b83c8
1. Install Catch2 from sources inside a Docker stage/layer 2. Some tweaks to Jenkinsfile
91 lines
2.2 KiB
Groovy
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'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|