Browse Source

Jenkinsfile add new Analysis stage (#10150)

sbg
Daniel Agar 7 years ago committed by GitHub
parent
commit
90f4e77a80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 114
      Jenkinsfile

114
Jenkinsfile vendored

@ -2,7 +2,8 @@ pipeline { @@ -2,7 +2,8 @@ pipeline {
agent none
stages {
stage('Test') {
stage('Analysis') {
parallel {
stage('Style Check') {
@ -96,23 +97,22 @@ pipeline { @@ -96,23 +97,22 @@ pipeline {
}
}
stage('tests') {
stage('check stack') {
agent {
docker {
image 'px4io/px4-dev-base:2018-07-19'
image 'px4io/px4-dev-nuttx:2018-07-19'
args '-e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
}
}
steps {
sh 'export'
sh 'make distclean'
sh 'make posix_sitl_default test_results_junit'
junit 'build/posix_sitl_default/JUnitTestResults.xml'
sh 'make px4fmu-v2_default stack_check'
sh 'make distclean'
}
}
stage('test mission (code coverage)') {
stage('code coverage (mission test)') {
agent {
docker {
image 'px4io/px4-dev-ros:2018-07-19'
@ -122,7 +122,7 @@ pipeline { @@ -122,7 +122,7 @@ pipeline {
steps {
sh 'export'
sh 'make distclean; rm -rf .ros; rm -rf .gazebo'
sh 'make tests_mission_coverage'
sh 'ulimit -c unlimited; make tests_mission_coverage'
withCredentials([string(credentialsId: 'FIRMWARE_CODECOV_TOKEN', variable: 'CODECOV_TOKEN')]) {
sh 'curl -s https://codecov.io/bash | bash -s'
}
@ -130,8 +130,55 @@ pipeline { @@ -130,8 +130,55 @@ pipeline {
}
}
stage('code coverage (unit tests)') {
agent {
docker {
image 'px4io/px4-dev-base:2018-07-19'
args '-e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
}
}
steps {
sh 'export'
sh 'make distclean'
sh 'ulimit -c unlimited; make tests_coverage'
withCredentials([string(credentialsId: 'FIRMWARE_CODECOV_TOKEN', variable: 'CODECOV_TOKEN')]) {
sh 'curl -s https://codecov.io/bash | bash -s'
}
sh 'make distclean'
}
post {
failure {
sh('ls -a')
sh('find . -name core')
sh('gdb --batch --quiet -ex "thread apply all bt full" -ex "quit" build/posix_sitl_default/px4 core')
}
}
}
} // parallel
} // stage Analysis
stage('Test') {
parallel {
stage('unit tests') {
agent {
docker {
image 'px4io/px4-dev-base:2018-07-19'
args '-e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
}
}
steps {
sh 'export'
sh 'make distclean'
sh 'make posix_sitl_default test_results_junit'
junit 'build/posix_sitl_default/JUnitTestResults.xml'
sh 'make distclean'
}
}
// TODO: PX4 requires clean shutdown first
// stage('tests (address sanitizer)') {
// stage('unit tests (address sanitizer)') {
// agent {
// docker {
// image 'px4io/px4-dev-base:2018-07-19'
@ -150,50 +197,8 @@ pipeline { @@ -150,50 +197,8 @@ pipeline {
// }
// }
// TODO: test and re-enable once GDB is available in px4-dev-ros
// stage('tests (code coverage)') {
// agent {
// docker {
// image 'px4io/px4-dev-ros:2018-07-19'
// args '-e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
// }
// }
// steps {
// sh 'export'
// sh 'make distclean'
// sh 'ulimit -c unlimited; make tests_coverage'
// sh 'ls'
// withCredentials([string(credentialsId: 'FIRMWARE_CODECOV_TOKEN', variable: 'CODECOV_TOKEN')]) {
// sh 'curl -s https://codecov.io/bash | bash -s'
// }
// sh 'make distclean'
// }
// post {
// failure {
// sh('find . -name core')
// sh('gdb --batch --quiet -ex "thread apply all bt full" -ex "quit" build/posix_sitl_default/px4 core')
// }
// }
// }
stage('check stack') {
agent {
docker {
image 'px4io/px4-dev-nuttx:2018-07-19'
args '-e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
}
}
steps {
sh 'export'
sh 'make distclean'
sh 'make px4fmu-v2_default stack_check'
sh 'make distclean'
}
}
}
}
} // parallel
} // stage Test
stage('Generate Metadata') {
@ -250,8 +255,9 @@ pipeline { @@ -250,8 +255,9 @@ pipeline {
sh 'make distclean'
}
}
}
}
} // parallel
} // stage: Generate Metadata
} // stages

Loading…
Cancel
Save