2017-10-27 11:47:38 -03:00
|
|
|
pipeline {
|
2017-11-28 13:32:26 -04:00
|
|
|
agent none
|
2017-10-27 11:47:38 -03:00
|
|
|
stages {
|
2017-12-06 20:25:15 -04:00
|
|
|
|
2018-08-04 13:51:51 -03:00
|
|
|
stage('Analysis') {
|
|
|
|
|
2017-10-30 11:20:23 -03:00
|
|
|
parallel {
|
2017-12-06 20:25:15 -04:00
|
|
|
|
2018-05-17 16:20:26 -03:00
|
|
|
stage('Style Check') {
|
|
|
|
agent {
|
2018-07-21 14:26:10 -03:00
|
|
|
docker { image 'px4io/px4-dev-base:2018-07-19' }
|
2018-05-17 16:20:26 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
steps {
|
|
|
|
sh 'make check_format'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-08-04 13:58:09 -03:00
|
|
|
stage('bloaty px4fmu-v2') {
|
|
|
|
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 'ccache -z'
|
|
|
|
sh 'git fetch --tags'
|
|
|
|
sh 'make nuttx_px4fmu-v2_default'
|
|
|
|
sh 'make nuttx_px4fmu-v2_default bloaty_symbols'
|
|
|
|
sh 'make nuttx_px4fmu-v2_default bloaty_compileunits'
|
|
|
|
sh 'make nuttx_px4fmu-v2_default bloaty_inlines'
|
|
|
|
sh 'make nuttx_px4fmu-v2_default bloaty_templates'
|
|
|
|
sh 'make nuttx_px4fmu-v2_default bloaty_compare_master'
|
|
|
|
sh 'make sizes'
|
|
|
|
sh 'ccache -s'
|
|
|
|
sh 'make distclean'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stage('bloaty px4fmu-v5') {
|
|
|
|
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 'ccache -z'
|
|
|
|
sh 'git fetch --tags'
|
|
|
|
sh 'make nuttx_px4fmu-v5_default'
|
|
|
|
sh 'make nuttx_px4fmu-v5_default bloaty_symbols'
|
|
|
|
sh 'make nuttx_px4fmu-v5_default bloaty_compileunits'
|
|
|
|
sh 'make nuttx_px4fmu-v5_default bloaty_inlines'
|
|
|
|
sh 'make nuttx_px4fmu-v5_default bloaty_templates'
|
|
|
|
sh 'make nuttx_px4fmu-v5_default bloaty_compare_master'
|
|
|
|
sh 'make sizes'
|
|
|
|
sh 'ccache -s'
|
|
|
|
sh 'make distclean'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-12-15 10:59:15 -04:00
|
|
|
stage('clang analyzer') {
|
|
|
|
agent {
|
|
|
|
docker {
|
2018-07-21 14:26:10 -03:00
|
|
|
image 'px4io/px4-dev-clang:2018-07-19'
|
2018-02-05 15:08:27 -04:00
|
|
|
args '-e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
|
2017-12-15 10:59:15 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
steps {
|
2018-02-05 15:08:27 -04:00
|
|
|
sh 'export'
|
2018-01-09 02:12:55 -04:00
|
|
|
sh 'make distclean'
|
2017-12-15 10:59:15 -04:00
|
|
|
sh 'make scan-build'
|
|
|
|
// publish html
|
|
|
|
publishHTML target: [
|
2017-12-15 11:53:55 -04:00
|
|
|
reportTitles: 'clang static analyzer',
|
2017-12-15 10:59:15 -04:00
|
|
|
allowMissing: false,
|
2017-12-15 11:53:55 -04:00
|
|
|
alwaysLinkToLastBuild: true,
|
2017-12-15 10:59:15 -04:00
|
|
|
keepAll: true,
|
2017-12-15 11:53:55 -04:00
|
|
|
reportDir: 'build/scan-build/report_latest',
|
2017-12-15 10:59:15 -04:00
|
|
|
reportFiles: '*',
|
|
|
|
reportName: 'Clang Static Analyzer'
|
|
|
|
]
|
2018-03-23 02:09:33 -03:00
|
|
|
sh 'make distclean'
|
2017-12-15 10:59:15 -04:00
|
|
|
}
|
2018-01-01 10:59:22 -04:00
|
|
|
when {
|
|
|
|
anyOf {
|
|
|
|
branch 'master'
|
|
|
|
branch 'beta'
|
|
|
|
branch 'stable'
|
2018-08-04 13:23:46 -03:00
|
|
|
branch 'pr-jenkins' // for testing
|
2018-01-01 10:59:22 -04:00
|
|
|
}
|
|
|
|
}
|
2017-12-15 10:59:15 -04:00
|
|
|
}
|
|
|
|
|
2017-12-15 10:46:38 -04:00
|
|
|
stage('clang tidy') {
|
|
|
|
agent {
|
|
|
|
docker {
|
2018-03-30 15:01:29 -03:00
|
|
|
image 'px4io/px4-dev-clang:2018-03-30'
|
2018-02-05 15:08:27 -04:00
|
|
|
args '-e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
|
2017-12-15 10:46:38 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
steps {
|
2018-02-05 15:08:27 -04:00
|
|
|
sh 'export'
|
2018-01-09 02:12:55 -04:00
|
|
|
sh 'make distclean'
|
2017-12-15 10:46:38 -04:00
|
|
|
sh 'make clang-tidy-quiet'
|
2018-03-23 02:09:33 -03:00
|
|
|
sh 'make distclean'
|
2017-12-15 10:46:38 -04:00
|
|
|
}
|
|
|
|
}
|
2017-12-06 20:25:15 -04:00
|
|
|
|
2017-12-15 11:34:24 -04:00
|
|
|
stage('cppcheck') {
|
|
|
|
agent {
|
|
|
|
docker {
|
|
|
|
image 'px4io/px4-dev-base:ubuntu17.10'
|
2018-02-05 15:08:27 -04:00
|
|
|
args '-e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
|
2017-12-15 11:34:24 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
steps {
|
2018-02-05 15:08:27 -04:00
|
|
|
sh 'export'
|
2018-01-09 02:12:55 -04:00
|
|
|
sh 'make distclean'
|
2017-12-15 11:34:24 -04:00
|
|
|
sh 'make cppcheck'
|
|
|
|
// publish html
|
|
|
|
publishHTML target: [
|
2017-12-15 11:53:55 -04:00
|
|
|
reportTitles: 'Cppcheck',
|
2017-12-15 11:34:24 -04:00
|
|
|
allowMissing: false,
|
2017-12-15 11:53:55 -04:00
|
|
|
alwaysLinkToLastBuild: true,
|
2017-12-15 11:34:24 -04:00
|
|
|
keepAll: true,
|
2017-12-15 11:53:55 -04:00
|
|
|
reportDir: 'build/cppcheck/',
|
2017-12-15 11:34:24 -04:00
|
|
|
reportFiles: '*',
|
2017-12-15 11:53:55 -04:00
|
|
|
reportName: 'Cppcheck'
|
2017-12-15 11:34:24 -04:00
|
|
|
]
|
2018-03-23 02:09:33 -03:00
|
|
|
sh 'make distclean'
|
2017-12-15 11:34:24 -04:00
|
|
|
}
|
2018-01-01 10:59:22 -04:00
|
|
|
when {
|
|
|
|
anyOf {
|
|
|
|
branch 'master'
|
|
|
|
branch 'beta'
|
|
|
|
branch 'stable'
|
2018-08-04 13:23:46 -03:00
|
|
|
branch 'pr-jenkins' // for testing
|
2018-01-01 10:59:22 -04:00
|
|
|
}
|
|
|
|
}
|
2017-12-15 11:34:24 -04:00
|
|
|
}
|
|
|
|
|
2018-08-04 13:51:51 -03:00
|
|
|
stage('check stack') {
|
2017-11-28 13:32:26 -04:00
|
|
|
agent {
|
|
|
|
docker {
|
2018-08-04 13:51:51 -03:00
|
|
|
image 'px4io/px4-dev-nuttx:2018-07-19'
|
2018-02-05 15:08:27 -04:00
|
|
|
args '-e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
|
2017-11-28 13:32:26 -04:00
|
|
|
}
|
|
|
|
}
|
2017-10-30 11:20:23 -03:00
|
|
|
steps {
|
2018-02-05 15:08:27 -04:00
|
|
|
sh 'export'
|
2018-01-09 02:12:55 -04:00
|
|
|
sh 'make distclean'
|
2018-08-04 13:51:51 -03:00
|
|
|
sh 'make px4fmu-v2_default stack_check'
|
2018-03-23 02:09:33 -03:00
|
|
|
sh 'make distclean'
|
2017-10-30 11:20:23 -03:00
|
|
|
}
|
|
|
|
}
|
2017-12-06 20:25:15 -04:00
|
|
|
|
2018-08-04 13:51:51 -03:00
|
|
|
stage('code coverage (mission test)') {
|
2018-05-05 17:55:36 -03:00
|
|
|
agent {
|
|
|
|
docker {
|
2018-07-21 14:26:10 -03:00
|
|
|
image 'px4io/px4-dev-ros:2018-07-19'
|
2018-05-05 17:55:36 -03:00
|
|
|
args '-e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw -e HOME=$WORKSPACE'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
steps {
|
|
|
|
sh 'export'
|
|
|
|
sh 'make distclean; rm -rf .ros; rm -rf .gazebo'
|
2018-08-04 13:51:51 -03:00
|
|
|
sh 'ulimit -c unlimited; make tests_mission_coverage'
|
2018-05-05 17:55:36 -03:00
|
|
|
withCredentials([string(credentialsId: 'FIRMWARE_CODECOV_TOKEN', variable: 'CODECOV_TOKEN')]) {
|
2018-08-04 14:10:38 -03:00
|
|
|
sh 'curl -s https://codecov.io/bash | bash -s - -F mission'
|
2018-05-05 17:55:36 -03:00
|
|
|
}
|
|
|
|
sh 'make distclean'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-08-04 13:51:51 -03:00
|
|
|
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'
|
2018-08-04 19:22:08 -03:00
|
|
|
sh 'ulimit -c unlimited; make tests_coverage || true' // always pass for now
|
2018-08-04 13:51:51 -03:00
|
|
|
withCredentials([string(credentialsId: 'FIRMWARE_CODECOV_TOKEN', variable: 'CODECOV_TOKEN')]) {
|
2018-08-04 14:10:38 -03:00
|
|
|
sh 'curl -s https://codecov.io/bash | bash -s - -F unittests'
|
2018-08-04 13:51:51 -03:00
|
|
|
}
|
|
|
|
sh 'make distclean'
|
|
|
|
}
|
|
|
|
post {
|
|
|
|
failure {
|
|
|
|
sh('ls -a')
|
|
|
|
sh('find . -name core')
|
2018-08-04 14:32:59 -03:00
|
|
|
sh('gdb --batch --quiet -ex "thread apply all bt full" -ex "quit" build/posix_sitl_default/px4 core || true') // always pass for now
|
2018-08-04 13:51:51 -03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-08-04 19:22:08 -03:00
|
|
|
stage('code coverage (python)') {
|
|
|
|
agent {
|
|
|
|
docker {
|
|
|
|
image 'px4io/px4-dev-base:2018-08-04'
|
|
|
|
args '-e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
steps {
|
|
|
|
sh 'export'
|
|
|
|
sh 'make distclean'
|
|
|
|
sh 'make python_coverage'
|
|
|
|
withCredentials([string(credentialsId: 'FIRMWARE_CODECOV_TOKEN', variable: 'CODECOV_TOKEN')]) {
|
|
|
|
sh 'curl -s https://codecov.io/bash | bash -s - -F python'
|
|
|
|
}
|
|
|
|
sh 'make distclean'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-08-04 13:51:51 -03:00
|
|
|
} // 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'
|
2018-08-04 14:35:03 -03:00
|
|
|
sh 'ccache -z'
|
2018-08-04 13:51:51 -03:00
|
|
|
sh 'make posix_sitl_default test_results_junit'
|
2018-08-04 14:35:03 -03:00
|
|
|
sh 'ccache -s'
|
2018-08-04 13:51:51 -03:00
|
|
|
junit 'build/posix_sitl_default/JUnitTestResults.xml'
|
|
|
|
sh 'make distclean'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-08-04 14:35:03 -03:00
|
|
|
stage('unit tests (address sanitizer)') {
|
|
|
|
agent {
|
|
|
|
docker {
|
|
|
|
image 'px4io/px4-dev-base:2018-07-19'
|
|
|
|
args '-e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
environment {
|
|
|
|
PX4_ASAN = 1
|
|
|
|
ASAN_OPTIONS = "color=always:check_initialization_order=1:detect_stack_use_after_return=1"
|
|
|
|
}
|
|
|
|
steps {
|
|
|
|
sh 'export'
|
|
|
|
sh 'make distclean'
|
|
|
|
sh 'ccache -z'
|
|
|
|
sh 'make tests || true' // always pass for now, TODO: PX4 sitl clean shutdown
|
|
|
|
sh 'ccache -s'
|
|
|
|
sh 'make distclean'
|
|
|
|
}
|
|
|
|
}
|
2018-05-05 17:55:36 -03:00
|
|
|
|
2018-08-04 13:51:51 -03:00
|
|
|
} // parallel
|
|
|
|
} // stage Test
|
2017-12-06 20:25:15 -04:00
|
|
|
|
2017-11-28 13:32:26 -04:00
|
|
|
stage('Generate Metadata') {
|
2017-12-10 03:32:21 -04:00
|
|
|
|
|
|
|
parallel {
|
|
|
|
|
|
|
|
stage('airframe') {
|
|
|
|
agent {
|
2018-07-21 14:26:10 -03:00
|
|
|
docker { image 'px4io/px4-dev-base:2018-07-19' }
|
2017-12-10 03:32:21 -04:00
|
|
|
}
|
|
|
|
steps {
|
2018-02-02 01:09:29 -04:00
|
|
|
sh 'make distclean'
|
2017-12-10 03:32:21 -04:00
|
|
|
sh 'make airframe_metadata'
|
2018-08-04 19:22:08 -03:00
|
|
|
dir('build/posix_sitl_default/docs') {
|
|
|
|
archiveArtifacts(artifacts: 'airframes.md, airframes.xml')
|
|
|
|
}
|
2018-03-23 02:09:33 -03:00
|
|
|
sh 'make distclean'
|
2017-12-10 03:32:21 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stage('parameter') {
|
|
|
|
agent {
|
2018-07-21 14:26:10 -03:00
|
|
|
docker { image 'px4io/px4-dev-base:2018-07-19' }
|
2017-12-10 03:32:21 -04:00
|
|
|
}
|
|
|
|
steps {
|
2018-02-02 01:09:29 -04:00
|
|
|
sh 'make distclean'
|
2017-12-10 03:32:21 -04:00
|
|
|
sh 'make parameters_metadata'
|
2018-08-04 19:22:08 -03:00
|
|
|
dir('build/posix_sitl_default/docs') {
|
|
|
|
archiveArtifacts(artifacts: 'parameters.md, parameters.xml')
|
|
|
|
}
|
2018-03-23 02:09:33 -03:00
|
|
|
sh 'make distclean'
|
2017-12-10 03:32:21 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stage('module') {
|
|
|
|
agent {
|
2018-07-21 14:26:10 -03:00
|
|
|
docker { image 'px4io/px4-dev-base:2018-07-19' }
|
2017-12-10 03:32:21 -04:00
|
|
|
}
|
|
|
|
steps {
|
2018-02-02 01:09:29 -04:00
|
|
|
sh 'make distclean'
|
2017-12-10 03:32:21 -04:00
|
|
|
sh 'make module_documentation'
|
2018-08-04 19:22:08 -03:00
|
|
|
dir('build/posix_sitl_default/docs') {
|
|
|
|
archiveArtifacts(artifacts: 'modules/*.md')
|
|
|
|
}
|
2018-03-23 02:09:33 -03:00
|
|
|
sh 'make distclean'
|
2017-12-10 03:32:21 -04:00
|
|
|
}
|
2017-11-28 13:32:26 -04:00
|
|
|
}
|
2018-01-05 18:20:39 -04:00
|
|
|
|
|
|
|
stage('uorb graphs') {
|
|
|
|
agent {
|
2018-01-05 23:57:17 -04:00
|
|
|
docker {
|
2018-07-21 14:26:10 -03:00
|
|
|
image 'px4io/px4-dev-nuttx:2018-07-19'
|
2018-02-05 15:08:27 -04:00
|
|
|
args '-e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
|
2018-01-05 23:57:17 -04:00
|
|
|
}
|
2018-01-05 18:20:39 -04:00
|
|
|
}
|
|
|
|
steps {
|
2018-02-05 15:08:27 -04:00
|
|
|
sh 'export'
|
2018-02-02 01:09:29 -04:00
|
|
|
sh 'make distclean'
|
2018-01-05 18:20:39 -04:00
|
|
|
sh 'make uorb_graphs'
|
2018-08-04 19:22:08 -03:00
|
|
|
dir('Tools/uorb_graph') {
|
|
|
|
archiveArtifacts(artifacts: 'graph_sitl.json')
|
|
|
|
}
|
2018-03-23 02:09:33 -03:00
|
|
|
sh 'make distclean'
|
2018-01-05 18:20:39 -04:00
|
|
|
}
|
|
|
|
}
|
2018-08-04 13:51:51 -03:00
|
|
|
|
|
|
|
} // parallel
|
|
|
|
} // stage: Generate Metadata
|
2017-12-06 20:25:15 -04:00
|
|
|
|
2018-03-23 02:09:33 -03:00
|
|
|
} // stages
|
|
|
|
|
2018-02-05 15:08:27 -04:00
|
|
|
environment {
|
|
|
|
CCACHE_DIR = '/tmp/ccache'
|
|
|
|
CI = true
|
|
|
|
}
|
2017-12-10 03:32:21 -04:00
|
|
|
options {
|
2018-03-23 02:09:33 -03:00
|
|
|
buildDiscarder(logRotator(numToKeepStr: '10', artifactDaysToKeepStr: '30'))
|
2017-12-10 03:32:21 -04:00
|
|
|
timeout(time: 60, unit: 'MINUTES')
|
2017-10-27 11:47:38 -03:00
|
|
|
}
|
2017-11-05 16:04:14 -04:00
|
|
|
}
|