fsfw/automation/Jenkinsfile

91 lines
2.2 KiB
Plaintext
Raw Normal View History

2021-10-25 14:59:16 +02:00
pipeline {
agent any
2021-10-26 20:30:22 +02:00
environment {
DOCKER_TAG = 'fsfw-build'
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 {
stage('Build Container') {
when {
anyOf {
changeset "automation/Dockerfile";
changelog 'cleanDocker'
2021-10-26 20:30:22 +02:00
}
}
2021-10-25 14:59:16 +02:00
steps {
sh 'docker build -t $DOCKER_TAG - < automation/Dockerfile'
}
}
2022-01-26 15:30:01 +01:00
stage('Clean') {
agent {
docker {
image '$DOCKER_TAG'
reuseNode true
}
}
2022-01-26 15:30:01 +01:00
when {
anyOf {
changelog 'cleanCI'
changeset '*.cmake'
changeset 'CMakeLists.txt'
}
}
steps {
sh 'rm -rf $BUILDDIR'
}
}
stage('Configure') {
agent {
docker {
image '$DOCKER_TAG'
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 {
docker {
image '$DOCKER_TAG'
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 {
docker {
image '$DOCKER_TAG'
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 {
docker {
image '$DOCKER_TAG'
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
}
}