Browse Source

Jenkinsfile add all NuttX, Raspberrypi, Bebop, Ocpoc builds (#8381)

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

180
Jenkinsfile vendored

@ -1,58 +1,170 @@
pipeline { pipeline {
agent { agent none
docker { options {
image 'px4io/px4-dev-simulation:2017-10-23' buildDiscarder(logRotator(numToKeepStr: '10'))
args '--env CCACHE_DISABLE=1 --env CI=true' timeout(time: 20, unit: 'MINUTES')
} timestamps()
} }
stages { stages {
stage('Quality Checks') {
steps {
sh 'make check_format'
}
}
stage('Build') { stage('Build') {
steps {
sh 'make clean'
sh 'make nuttx_px4fmu-v2_default'
archiveArtifacts 'build/*/*.px4'
}
}
stage('Test') {
steps { steps {
sh 'make clean' script {
sh 'make posix_sitl_default test_results_junit' def builds = [:]
junit 'build/posix_sitl_default/JUnitTestResults.xml'
for (def option in ["px4fmu-v2", "px4fmu-v3", "px4fmu-v4", "px4fmu-v4pro", "px4fmu-v5", "aerocore2", "aerofc-v1", "auav-x21", "crazyflie", "mindpx-v2", "tap-v1", "nxphlite-v3"]) {
def node_name = "nuttx_${option}_default"
builds["${node_name}"] = {
node {
stage("Build Test ${node_name}") {
docker.image('px4io/px4-dev-nuttx:2017-10-23').inside("--env CCACHE_DIR=/tmp/ccache --volume=/tmp/ccache:/tmp/ccache:rw --env CI=true") {
stage("${node_name}") {
checkout scm
sh "ccache -z; make clean; make ${node_name}; ccache -s"
archive 'build/*/*.px4'
}
}
}
}
}
}
for (def option in ["px4fmu-v2_lpe", "px4-same70xplained-v1_default", "px4-stm32f4discovery_default", "px4cannode-v1_default", "px4esc-v1_default", "px4nucleoF767ZI-v1_default", "s2740vc-v1_default"]) {
def node_name = "nuttx_${option}"
builds["${node_name}"] = {
node {
stage("Build Test ${node_name}") {
docker.image('px4io/px4-dev-nuttx:2017-10-23').inside("--env CCACHE_DIR=/tmp/ccache --volume=/tmp/ccache:/tmp/ccache:rw --env CI=true") {
stage("${node_name}") {
checkout scm
sh "ccache -z; make clean; make ${node_name}; ccache -s"
}
}
}
}
}
}
for (def option in ["rpi_cross", "bebop_default"]) {
def node_name = "posix_${option}"
builds["${node_name}"] = {
node {
stage("Build Test ${node_name}") {
docker.image('px4io/px4-dev-raspi:2017-10-23').inside("--env CCACHE_DISABLE=1 --env CI=true") {
stage("${node_name}") {
checkout scm
sh "make clean; make ${node_name}"
}
}
}
}
}
}
for (def option in ["ocpoc_ubuntu"]) {
def node_name = "posix_${option}"
builds["${node_name}"] = {
node {
stage("Build Test ${node_name}") {
docker.image('px4io/px4-dev-armhf:2017-10-23').inside("--env CCACHE_DISABLE=1 --env CI=true") {
stage("${node_name}") {
checkout scm
sh "make clean; make ${node_name}"
}
}
}
}
}
}
parallel builds
}
} }
} }
stage('Generate Metadata') { stage('Test') {
parallel { parallel {
stage('airframe') { stage('check_format') {
agent {
docker {
image 'px4io/px4-dev-base:2017-10-23'
args '--env CCACHE_DIR=/tmp/ccache --volume=/tmp/ccache:/tmp/ccache:rw --env CI=true'
}
}
steps {
sh 'make check_format'
}
}
stage('clang-tidy') {
agent {
docker {
image 'px4io/px4-dev-clang:2017-10-23'
args '--env CCACHE_DIR=/tmp/ccache --volume=/tmp/ccache:/tmp/ccache:rw --env CI=true'
}
}
steps { steps {
sh 'make clean' sh 'make clean; make clang-tidy-quiet'
sh 'make airframe_metadata'
archiveArtifacts 'airframes.md, airframes.xml'
} }
} }
stage('parameters') { stage('tests') {
agent {
docker {
image 'px4io/px4-dev-base:2017-10-23'
args '--env CCACHE_DIR=/tmp/ccache --volume=/tmp/ccache:/tmp/ccache:rw --env CI=true'
}
}
steps { steps {
sh 'make clean' sh 'make clean; make posix_sitl_default test_results_junit'
sh 'make parameters_metadata' junit 'build/posix_sitl_default/JUnitTestResults.xml'
archiveArtifacts 'parameters.md, parameters.xml'
} }
} }
stage('modules') { stage('tests coverage') {
agent {
docker {
image 'px4io/px4-dev-base:2017-10-23'
args '--env CCACHE_DIR=/tmp/ccache --volume=/tmp/ccache:/tmp/ccache:rw --env CI=true'
}
}
steps { steps {
sh 'make clean' sh 'make clean; make tests_coverage'
sh 'make module_documentation' // publish html
archiveArtifacts 'modules/*.md' publishHTML target: [
allowMissing: false,
alwaysLinkToLastBuild: false,
keepAll: true,
reportDir: 'build/posix_sitl_default/coverage-html',
reportFiles: '*',
reportName: 'Coverage Report'
]
} }
} }
} }
} }
stage('Generate Metadata') {
agent {
docker {
image 'px4io/px4-dev-base:2017-10-23'
}
}
steps {
sh 'make airframe_metadata'
archive 'airframes.md, airframes.xml'
sh 'make parameters_metadata'
archive 'parameters.md, parameters.xml'
sh 'make module_documentation'
archive 'modules/*.md'
}
}
stage('S3 Upload') { stage('S3 Upload') {
agent {
docker {
image 'px4io/px4-dev-base:2017-10-23'
}
}
when { when {
branch 'master|beta|stable' branch '*/master|*/beta|*/stable'
} }
steps { steps {
sh 'echo "uploading to S3"' sh 'echo "uploading to S3"'

Loading…
Cancel
Save