mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-21 01:12:11 +00:00
Jenkinsfile add new Analysis stage (#10150)
This commit is contained in:
140
Jenkinsfile
vendored
140
Jenkinsfile
vendored
@@ -2,7 +2,8 @@ pipeline {
|
|||||||
agent none
|
agent none
|
||||||
stages {
|
stages {
|
||||||
|
|
||||||
stage('Test') {
|
stage('Analysis') {
|
||||||
|
|
||||||
parallel {
|
parallel {
|
||||||
|
|
||||||
stage('Style Check') {
|
stage('Style Check') {
|
||||||
@@ -96,7 +97,71 @@ pipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('tests') {
|
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'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('code coverage (mission test)') {
|
||||||
|
agent {
|
||||||
|
docker {
|
||||||
|
image 'px4io/px4-dev-ros:2018-07-19'
|
||||||
|
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'
|
||||||
|
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'
|
||||||
|
}
|
||||||
|
sh 'make distclean'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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 {
|
agent {
|
||||||
docker {
|
docker {
|
||||||
image 'px4io/px4-dev-base:2018-07-19'
|
image 'px4io/px4-dev-base:2018-07-19'
|
||||||
@@ -112,26 +177,8 @@ pipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('test mission (code coverage)') {
|
|
||||||
agent {
|
|
||||||
docker {
|
|
||||||
image 'px4io/px4-dev-ros:2018-07-19'
|
|
||||||
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'
|
|
||||||
sh 'make tests_mission_coverage'
|
|
||||||
withCredentials([string(credentialsId: 'FIRMWARE_CODECOV_TOKEN', variable: 'CODECOV_TOKEN')]) {
|
|
||||||
sh 'curl -s https://codecov.io/bash | bash -s'
|
|
||||||
}
|
|
||||||
sh 'make distclean'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: PX4 requires clean shutdown first
|
// TODO: PX4 requires clean shutdown first
|
||||||
// stage('tests (address sanitizer)') {
|
// stage('unit tests (address sanitizer)') {
|
||||||
// agent {
|
// agent {
|
||||||
// docker {
|
// docker {
|
||||||
// image 'px4io/px4-dev-base:2018-07-19'
|
// image 'px4io/px4-dev-base:2018-07-19'
|
||||||
@@ -150,50 +197,8 @@ pipeline {
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// TODO: test and re-enable once GDB is available in px4-dev-ros
|
} // parallel
|
||||||
// stage('tests (code coverage)') {
|
} // stage Test
|
||||||
// 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'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Generate Metadata') {
|
stage('Generate Metadata') {
|
||||||
|
|
||||||
@@ -250,8 +255,9 @@ pipeline {
|
|||||||
sh 'make distclean'
|
sh 'make distclean'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
} // parallel
|
||||||
|
} // stage: Generate Metadata
|
||||||
|
|
||||||
} // stages
|
} // stages
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user