Skip to content

Commit

Permalink
Merge pull request #162 in SWDEV/franka_ros from bugfix/SRR-1221-jenk…
Browse files Browse the repository at this point in the history
…ins-catkin to develop

* commit 'c8a52a565cde29aa3281a1cb07ccd8f4b1e74056':
  Improved formatting of Jenkins and moved Checkgitsync at the end
  Refactor of Jenkinsfile to use catkin tools and caktin make
  Parallel building in Jenkinsfile
  • Loading branch information
falfab committed Dec 9, 2021
2 parents 1e3f11b + c8a52a5 commit f354b42
Show file tree
Hide file tree
Showing 3 changed files with 109 additions and 110 deletions.
21 changes: 0 additions & 21 deletions .ci/build.sh

This file was deleted.

21 changes: 0 additions & 21 deletions .ci/test.sh

This file was deleted.

177 changes: 109 additions & 68 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,93 +5,134 @@ pipeline {
}
options {
checkoutToSubdirectory('src/franka_ros')
parallelsAlwaysFailFast()
}
environment {
CMAKE_BUILD_PARALLEL_LEVEL=sh(script: 'nproc', returnStdout: true).trim().toInteger()
}
stages {
stage('Notify Stash') {
steps {
script {
notifyBitbucket()
}
}
}
stage('Build & Test') {
parallel {
stage('Melodic') {
agent {
dockerfile {
filename '.ci/Dockerfile.melodic'
dir 'src/franka_ros'
}
matrix {
agent {
dockerfile {
filename ".ci/Dockerfile.${env.DISTRO}"
dir 'src/franka_ros'
}
}
axes {
axis {
name 'DISTRO'
values 'melodic', 'noetic'
}
axis {
name 'BUILD_TOOL'
values 'catkin_make', 'catkin build'
}
stages {
stage('Build') {
steps {
sh ''' . /opt/ros/melodic/setup.sh
./src/franka_ros/.ci/build.sh
'''
}
stages {
stage('Notify Stash') {
when {
allOf {
environment name: 'DISTRO', value: 'noetic'
environment name: 'BUILD_TOOL', value: 'catkin_make'
}
}
stage('Test') {
steps {
sh ''' . /opt/ros/melodic/setup.sh
export HOME=$(pwd)
./src/franka_ros/.ci/test.sh
'''
}
post {
always {
junit 'build-debug/test_results/**/*.xml'
}
steps {
script {
notifyBitbucket()
}
}
}
}
stage('Noetic') {
agent {
dockerfile {
filename '.ci/Dockerfile.noetic'
dir 'src/franka_ros'
stage('Build w/ Catkin Make') {
when {
environment name: 'BUILD_TOOL', value: 'catkin_make'
}
steps {
sh '''
. /opt/ros/${DISTRO}/setup.sh
rm -rf src/CMakeLists.txt build devel
catkin_init_workspace src
${BUILD_TOOL} -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
'''
}
}
stages {
stage('Build') {
steps {
sh ''' . /opt/ros/noetic/setup.sh
./src/franka_ros/.ci/build.sh
'''
}
stage('Build w/ Catkin Tools') {
when {
environment name: 'BUILD_TOOL', value: 'catkin build'
}
environment {
HOME=sh(script: 'pwd', returnStdout: true).trim()
SPACE_SUFFIX='_catkin_tools'
}
steps {
sh '''
. /opt/ros/${DISTRO}/setup.sh
rm -rf *${SPACE_SUFFIX}
catkin config --workspace . --init --extend /opt/ros/${DISTRO} \\
--space-suffix ${SPACE_SUFFIX}
${BUILD_TOOL} --no-status
'''
}
}
stage('Check Format') {
when {
environment name: 'BUILD_TOOL', value: 'catkin_make'
}
steps {
sh '''
cmake --build build --target check-format
'''
}
}
stage('Check Linting') {
when {
environment name: 'BUILD_TOOL', value: 'catkin_make'
}
steps {
sh '''
. /opt/ros/${DISTRO}/setup.sh
cmake --build build --target check-tidy
'''
}
}
stage('Test') {
when {
environment name: 'BUILD_TOOL', value: 'catkin_make'
}
environment {
HOME=sh(script: 'pwd', returnStdout: true).trim()
}
stage('Test') {
steps {
sh ''' . /opt/ros/noetic/setup.sh
export HOME=$(pwd)
./src/franka_ros/.ci/test.sh
'''
steps {
sh '''
. /opt/ros/${DISTRO}/setup.sh
${BUILD_TOOL} run_tests
catkin_test_results
'''
}
post {
always {
junit 'build/test_results/**/*.xml'
}
post {
always {
junit 'build-debug/test_results/**/*.xml'
}
}
}
stage('Check commit history sync') {
when {
allOf {
environment name: 'DISTRO', value: 'noetic'
environment name: 'BUILD_TOOL', value: 'catkin_make'
}
}
steps {
sh """
cd src/franka_ros
.ci/checkgithistory.sh \\
https://github.com/frankaemika/franka_ros.git develop
"""
}
}
}
}
}
stage('Check commit history sync') {
agent {
dockerfile {
filename '.ci/Dockerfile.noetic'
dir 'src/franka_ros'
}
}
steps {
sh """
cd src/franka_ros
.ci/checkgithistory.sh https://github.com/frankaemika/franka_ros.git develop
"""
}
}
}
post {
always {
Expand Down

0 comments on commit f354b42

Please sign in to comment.