최예리

Delete not necessary file

Showing 72 changed files with 0 additions and 4830 deletions
--ignore-dir=Documentation
#!/usr/bin/env groovy
pipeline {
agent none
stages {
stage('Build') {
steps {
script {
def build_nodes = [:]
def docker_images = [
armhf: "px4io/px4-dev-armhf:2021-04-29",
arm64: "px4io/px4-dev-aarch64:2021-04-29",
base: "px4io/px4-dev-base-bionic:2021-04-29",
nuttx: "px4io/px4-dev-nuttx-focal:2021-04-29",
snapdragon: "lorenzmeier/px4-dev-snapdragon:2020-04-01"
]
def armhf_builds = [
target: ["beaglebone_blue_default", "emlid_navio2_default", "px4_raspberrypi_default", "scumaker_pilotpi_default"],
image: docker_images.armhf,
archive: false
]
def arm64_builds = [
target: ["scumaker_pilotpi_arm64"],
image: docker_images.arm64,
archive: false
]
def base_builds = [
target: ["px4_sitl_rtps"],
image: docker_images.base,
archive: false
]
def nuttx_builds_archive = [
target: [
"airmind_mindpx-v2_default",
"ark_can-flow_canbootloader",
"ark_can-flow_default",
"av_x-v1_default",
"bitcraze_crazyflie_default",
"bitcraze_crazyflie21_default",
"cuav_can-gps-v1_canbootloader",
"cuav_can-gps-v1_default",
"cuav_nora_default",
"cuav_x7pro_default",
"cubepilot_cubeorange_default",
"cubepilot_cubeyellow_default",
"freefly_can-rtk-gps_canbootloader",
"freefly_can-rtk-gps_default",
"holybro_can-gps-v1_canbootloader",
"holybro_can-gps-v1_default",
"holybro_durandal-v1_default",
"holybro_kakutef7_default",
"holybro_pix32v5_default",
"modalai_fc-v1_default",
"modalai_fc-v1_rtps",
"modalai_fc-v2_default",
"mro_ctrl-zero-f7_default",
"mro_ctrl-zero-f7-oem_default",
"mro_ctrl-zero-h7_default",
"mro_ctrl-zero-h7-oem_default",
"mro_pixracerpro_default",
"mro_x21-777_default",
"mro_x21_default",
"nxp_fmuk66-e_default",
"nxp_fmuk66-e_rtps",
"nxp_fmuk66-e_socketcan",
"nxp_fmuk66-v3_default",
"nxp_fmuk66-v3_rtps",
"nxp_fmuk66-v3_socketcan",
"nxp_fmurt1062-v1_default",
"nxp_ucans32k146_default",
"nxp_ucans32k146_canbootloader",
"omnibus_f4sd_default",
"px4_fmu-v2_default",
"px4_fmu-v2_fixedwing",
"px4_fmu-v2_multicopter",
"px4_fmu-v2_rover",
"px4_fmu-v3_default",
"px4_fmu-v4_cannode",
"px4_fmu-v4_default",
"px4_fmu-v4pro_default",
"px4_fmu-v5_ctrlalloc",
"px4_fmu-v5_debug",
"px4_fmu-v5_default",
"px4_fmu-v5_fixedwing",
"px4_fmu-v5_multicopter",
"px4_fmu-v5_optimized",
"px4_fmu-v5_rover",
"px4_fmu-v5_rtps",
"px4_fmu-v5_stackcheck",
"px4_fmu-v5_uavcanv0periph",
"px4_fmu-v5_uavcanv1",
"px4_fmu-v5x_base_phy_DP83848C",
"px4_fmu-v5x_default",
"px4_fmu-v6u_default",
"px4_fmu-v6x_default",
"px4_io-v2_default",
"spracing_h7extreme_default",
"uvify_core_default"
],
image: docker_images.nuttx,
archive: true
]
def snapdragon_builds = [
target: ["atlflight_eagle_qurt", "atlflight_eagle_default"],
image: docker_images.snapdragon,
archive: false
]
def docker_builds = [
armhf_builds, base_builds, nuttx_builds_archive//, snapdragon_builds
]
for (def build_type = 0; build_type < docker_builds.size(); build_type++) {
for (def build_target = 0; build_target < docker_builds[build_type].target.size(); build_target++) {
build_nodes.put(docker_builds[build_type].target[build_target],
createBuildNode(docker_builds[build_type].archive, docker_builds[build_type].image, docker_builds[build_type].target[build_target])
)
}
}
parallel build_nodes
} // script
} // steps
} // stage Build
// TODO: actually upload artifacts to S3
// stage('S3 Upload') {
// agent {
// docker { image 'px4io/px4-dev-base-focal:2021-04-29' }
// }
// options {
// skipDefaultCheckout()
// }
// when {
// anyOf {
// branch 'master'
// branch 'beta'
// branch 'stable'
// branch 'pr-jenkins' // for testing
// }
// }
// steps {
// sh 'echo "uploading to S3"'
// }
// }
} // stages
environment {
CCACHE_DIR = '/tmp/ccache'
CI = true
}
options {
buildDiscarder(logRotator(numToKeepStr: '5', artifactDaysToKeepStr: '14'))
timeout(time: 90, unit: 'MINUTES')
}
}
def createBuildNode(Boolean archive, String docker_image, String target) {
return {
// TODO: fix the snapdragon image
bypass_entrypoint = ''
if (docker_image == 'lorenzmeier/px4-dev-snapdragon:2020-04-01') {
bypass_entrypoint = ' --entrypoint=""'
}
node {
docker.withRegistry('https://registry.hub.docker.com', 'docker_hub_dagar') {
docker.image(docker_image).inside('-e CCACHE_BASEDIR=${WORKSPACE} -v ${CCACHE_DIR}:${CCACHE_DIR}:rw' + bypass_entrypoint) {
stage(target) {
try {
sh('export')
checkout(scm)
sh('make distclean')
sh('git fetch --tags')
sh('ccache -s')
sh('make ' + target)
sh('ccache -s')
sh('make sizes')
if (archive) {
archiveArtifacts(allowEmptyArchive: false, artifacts: 'build/*/*.px4, build/*/*.elf, build/*/*.bin', fingerprint: true, onlyIfSuccessful: true)
}
sh('make ' + target + ' package')
archiveArtifacts(allowEmptyArchive: true, artifacts: 'build/*/*.tar.bz2', fingerprint: true, onlyIfSuccessful: true)
archiveArtifacts(allowEmptyArchive: true, artifacts: 'build/*/*.deb', fingerprint: true, onlyIfSuccessful: true)
}
catch (exc) {
throw (exc)
}
finally {
sh('make distclean')
}
}
}
}
}
}
}
This diff is collapsed. Click to expand it.
---
Checks: '*,
-android*,
-bugprone-integer-division,
-cert-dcl50-cpp,
-cert-env33-c,
-cert-err34-c,
-cert-err58-cpp,
-cert-msc30-c,
-cert-msc50-cpp,
-clang-analyzer-core.CallAndMessage,
-clang-analyzer-core.NullDereference,
-clang-analyzer-core.UndefinedBinaryOperatorResult,
-clang-analyzer-core.uninitialized.Assign,
-clang-analyzer-core.VLASize,
-clang-analyzer-cplusplus.NewDelete,
-clang-analyzer-cplusplus.NewDeleteLeaks,
-clang-analyzer-deadcode.DeadStores,
-clang-analyzer-optin.cplusplus.VirtualCall,
-clang-analyzer-optin.performance.Padding,
-clang-analyzer-security.insecureAPI.strcpy,
-clang-analyzer-unix.API,
-clang-analyzer-unix.cstring.BadSizeArg,
-clang-analyzer-unix.Malloc,
-clang-analyzer-unix.MallocSizeof,
-cppcoreguidelines-c-copy-assignment-signature,
-cppcoreguidelines-interfaces-global-init,
-cppcoreguidelines-no-malloc,
-cppcoreguidelines-owning-memory,
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
-cppcoreguidelines-pro-bounds-constant-array-index,
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
-cppcoreguidelines-pro-type-const-cast,
-cppcoreguidelines-pro-type-cstyle-cast,
-cppcoreguidelines-pro-type-member-init,
-cppcoreguidelines-pro-type-reinterpret-cast,
-cppcoreguidelines-pro-type-union-access,
-cppcoreguidelines-pro-type-vararg,
-cppcoreguidelines-special-member-functions,
-fuchsia-default-arguments,
-fuchsia-overloaded-operator,
-google-build-using-namespace,
-google-explicit-constructor,
-google-global-names-in-headers,
-google-readability-casting,
-google-readability-function-size,
-google-readability-namespace-comments,
-google-readability-todo,
-google-runtime-int,
-google-runtime-references,
-hicpp-deprecated-headers,
-hicpp-explicit-conversions,
-hicpp-function-size,
-hicpp-member-init,
-hicpp-no-array-decay,
-hicpp-no-assembler,
-hicpp-no-malloc,
-hicpp-signed-bitwise,
-hicpp-special-member-functions,
-hicpp-use-auto,
-hicpp-use-equals-default,
-hicpp-use-equals-delete,
-hicpp-use-override,
-hicpp-vararg,
-llvm-header-guard,
-llvm-include-order,
-llvm-namespace-comment,
-misc-incorrect-roundings,
-misc-macro-parentheses,
-misc-misplaced-widening-cast,
-misc-redundant-expression,
-misc-unconventional-assign-operator,
-misc-unused-parameters,
-modernize-deprecated-headers,
-modernize-loop-convert,
-modernize-pass-by-value,
-modernize-return-braced-init-list,
-modernize-use-auto,
-modernize-use-bool-literals,
-modernize-use-default-member-init,
-modernize-use-equals-default,
-modernize-use-equals-delete,
-modernize-use-override,
-modernize-use-using,
-performance-inefficient-string-concatenation,
-readability-avoid-const-params-in-decls,
-readability-container-size-empty,
-readability-else-after-return,
-readability-function-size,
-readability-implicit-bool-cast,
-readability-implicit-bool-conversion,
-readability-inconsistent-declaration-parameter-name,
-readability-named-parameter,
-readability-non-const-parameter,
-readability-redundant-declaration,
-readability-static-accessed-through-instance,
-readability-static-definition-in-anonymous-namespace,
'
WarningsAsErrors: '*'
CheckOptions:
- key: google-readability-function-size.BranchThreshold
value: '600'
- key: google-readability-function-size.LineThreshold
value: '4000'
- key: google-readability-function-size.StatementThreshold
value: '4000'
...
// For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.134.0/containers/cpp
{
"name": "px4-dev-nuttx",
"image": "px4io/px4-dev-nuttx-focal:2021-04-29",
"runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" ],
// Set *default* container specific settings.json values on container create.
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"chiehyu.vscode-astyle",
"dan-c-underwood.arm",
"fredericbonnet.cmake-test-adapter",
"github.vscode-pull-request-github",
"marus25.cortex-debug",
"ms-azuretools.vscode-docker",
"ms-iot.vscode-ros",
"ms-python.python",
"ms-vscode.cmake-tools",
"ms-vscode.cpptools",
"ms-vscode.cpptools-extension-pack",
"redhat.vscode-yaml",
"streetsidesoftware.code-spell-checker",
"twxs.cmake",
"uavcan.dsdl",
"wholroyd.jinja",
"zixuanwang.linkerscript"
],
"containerUser": "user",
"containerEnv": {
"LOCAL_USER_ID": "${localEnv:UID}"
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [14556],
}
* text=auto eol=lf
*.cmake text eol=lf
*.c text eol=lf
*.cc text eol=lf
*.cpp text eol=lf
*.h text eol=lf
*.hh text eol=lf
*.hpp text eol=lf
*.hxx text eol=lf
*.S text eol=lf
*.ipynb text eol=lf
*.m text eol=lf
*.mat binary
*.py text eol=lf
*.java text eol=lf
*.jar binary
*.xml text eol=lf
# PX4 mixers, msgs, etc
*.bin binary
*.mix text eol=lf
*.msg text eol=lf
*.config text eol=lf
*.sdf text eol=lf
*.uavcan text eol=lf
# NuttX
Makefile.* text eol=lf
*.defs text eol=lf
*.ld text eol=lf
*.csv text eol=lf
*.md text eol=lf
*.txt text eol=lf
# Scripts
*.bash text eol=lf
*.sh text eol=lf
*.zsh text eol=lf
# These are explicitly windows files and should use crlf
*.ps1 text eol=crlf
*.{cmd,[cC][mM][dD]} text eol=crlf
*.{bat,[bB][aA][tT]} text eol=crlf
# Serialisation
*.json text eol=lf
*.toml text eol=lf
*.xml text eol=lf
*.yaml text eol=lf
*.yml text eol=lf
# Graphics
*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
*.tif binary
*.tiff binary
*.ico binary
*.pdf binary
# SVG treated as an asset (binary) by default.
*.svg text eol=lf
# Text files where line endings should be preserved
*.patch -text
# Archives
*.7z binary
*.gz binary
*.tar binary
*.tgz binary
*.zip binary
# everything else
.gitattributes text eol=lf
.gitignore text eol=lf
Makefile text eol=lf
---
name: Bug report
about: Create a report to help us improve
---
**Describe the bug**
A clear and concise description of the bug.
**To Reproduce**
Steps to reproduce the behavior:
1. Drone switched on '...'
2. Uploaded mission '....' (attach QGC mission file)
3. Took off '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Log Files and Screenshots**
*Always* provide a link to the flight log file:
- Download the flight log file from the vehicle ([tutorial](https://docs.px4.io/master/en/getting_started/flight_reporting.html)).
- Share the link to a log showing the problem on [PX4 Flight Review](http://logs.px4.io/).
Add screenshots to help explain your problem.
**Drone (please complete the following information):**
- Describe the type of drone.
- Photo of the IMU / autopilot setup if possible.
**Additional context**
Add any other context about the problem here.
---
name: 🚀 Feature Request
about: Suggest an idea for this project
---
For general questions please use [PX4 Discuss](http://discuss.px4.io/) or [Slack](http://slack.px4.io/).
**Describe problem solved by the proposed feature**
A clear and concise description of the problem, if any, this feature will solve. E.g. I'm always frustrated when ...
**Describe your preferred solution**
A clear and concise description of what you want to happen.
**Describe possible alternatives**
A clear and concise description of alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots for the feature request here.
---
name: ⛔ Support Question
about: See [PX4 Discuss](http://discuss.px4.io/) for questions about using PX4.
---
We use GitHub issues only to discuss PX4 bugs and new features. For
questions about using PX4 or related components, please use [PX4 Discuss](http://discuss.px4.io/).
Thanks!
---
name: ⛔ Documentation Issue
about: See https://github.com/PX4/Devguide for documentation issues
---
PX4 has dedicated repositories for developer documentation (https://github.com/PX4/Devguide) and user documentation (https://github.com/PX4/px4_user_guide).
Thanks!
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 90
# Number of days of inactivity before a stale issue is closed, or `false` to disable
daysUntilClose: false
# Issues with these labels will never be considered stale
exemptLabels:
- pinned
# Label to use when marking an issue as stale
staleLabel: stale
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. Thank you for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false
name: Checks
on:
push:
branches:
- 'master'
pull_request:
branches:
- '*'
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
check: [
"check_format",
"tests",
"tests_coverage",
"px4_fmu-v2_default stack_check",
"validate_module_configs",
"shellcheck_all",
"NO_NINJA_BUILD=1 px4_fmu-v5_default",
"NO_NINJA_BUILD=1 px4_sitl_default",
"airframe_metadata",
"module_documentation",
"parameters_metadata",
]
container:
image: px4io/px4-dev-nuttx-focal:2021-04-29
options: --privileged --ulimit core=-1 --security-opt seccomp=unconfined
steps:
- uses: actions/checkout@v1
with:
token: ${{ secrets.ACCESS_TOKEN }}
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
message("::set-output name=timestamp::${current_date}")
- name: ccache cache files
uses: actions/cache@v2
with:
path: ~/.ccache
key: tests_${{matrix.ubuntu_release}}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}}
restore-keys: tests_${{matrix.ubuntu_release}}-ccache-
- name: setup ccache
run: |
mkdir -p ~/.ccache
echo "base_dir = ${GITHUB_WORKSPACE}" > ~/.ccache/ccache.conf
echo "compression = true" >> ~/.ccache/ccache.conf
echo "compression_level = 5" >> ~/.ccache/ccache.conf
echo "max_size = 100M" >> ~/.ccache/ccache.conf
ccache -s
ccache -z
- name: check environment
run: |
export
ulimit -a
- name: ${{matrix.check}}
run: make ${{matrix.check}}
- name: upload coverage
if: contains(matrix.check, 'coverage')
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unittests
file: coverage/lcov.info
name: Clang Tidy
on:
push:
branches:
- 'master'
pull_request:
branches:
- '*'
jobs:
build:
runs-on: ubuntu-latest
container: px4io/px4-dev-clang:2021-04-29
steps:
- uses: actions/checkout@v1
with:
token: ${{secrets.ACCESS_TOKEN}}
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
message("::set-output name=timestamp::${current_date}")
- name: ccache cache files
uses: actions/cache@v2
with:
path: ~/.ccache
key: clang-tidy-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}}
restore-keys: clang-tidy-ccache-
- name: setup ccache
run: |
mkdir -p ~/.ccache
echo "base_dir = ${GITHUB_WORKSPACE}" > ~/.ccache/ccache.conf
echo "compression = true" >> ~/.ccache/ccache.conf
echo "compression_level = 5" >> ~/.ccache/ccache.conf
echo "max_size = 100M" >> ~/.ccache/ccache.conf
ccache -s
ccache -z
- name: make clang-tidy-quiet
run: |
ccache -z
make clang-tidy-quiet
ccache -s
name: Linux Targets
on:
push:
branches:
- 'master'
pull_request:
branches:
- '*'
jobs:
build:
runs-on: ubuntu-latest
container: px4io/px4-dev-armhf:2021-04-29
strategy:
matrix:
config: [
beaglebone_blue_default,
emlid_navio2_default,
px4_raspberrypi_default,
scumaker_pilotpi_default,
]
steps:
- uses: actions/checkout@v1
with:
token: ${{secrets.ACCESS_TOKEN}}
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
message("::set-output name=timestamp::${current_date}")
- name: ccache cache files
uses: actions/cache@v2
with:
path: ~/.ccache
key: ${{matrix.config}}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}}
restore-keys: ${{matrix.config}}-ccache-
- name: setup ccache
run: |
mkdir -p ~/.ccache
echo "base_dir = ${GITHUB_WORKSPACE}" > ~/.ccache/ccache.conf
echo "compression = true" >> ~/.ccache/ccache.conf
echo "compression_level = 5" >> ~/.ccache/ccache.conf
echo "max_size = 100M" >> ~/.ccache/ccache.conf
ccache -s
ccache -z
- name: make ${{matrix.config}}
run: make ${{matrix.config}}
- name: ccache post-run
run: ccache -s
name: Linux ARM64 Targets
on:
push:
branches:
- 'master'
pull_request:
branches:
- '*'
jobs:
build:
runs-on: ubuntu-latest
container: px4io/px4-dev-aarch64:2021-04-29
strategy:
matrix:
config: [
scumaker_pilotpi_arm64,
]
steps:
- uses: actions/checkout@v1
with:
token: ${{secrets.ACCESS_TOKEN}}
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
message("::set-output name=timestamp::${current_date}")
- name: ccache cache files
uses: actions/cache@v2
with:
path: ~/.ccache
key: ${{matrix.config}}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}}
restore-keys: ${{matrix.config}}-ccache-
- name: setup ccache
run: |
mkdir -p ~/.ccache
echo "base_dir = ${GITHUB_WORKSPACE}" > ~/.ccache/ccache.conf
echo "compression = true" >> ~/.ccache/ccache.conf
echo "compression_level = 5" >> ~/.ccache/ccache.conf
echo "max_size = 100M" >> ~/.ccache/ccache.conf
ccache -s
ccache -z
- name: make ${{matrix.config}}
run: make ${{matrix.config}}
- name: ccache post-run
run: ccache -s
name: MacOS build
on:
push:
branches:
- 'master'
pull_request:
branches:
- '*'
jobs:
build:
runs-on: macos-10.15
strategy:
matrix:
config: [
px4_fmu-v5_default,
px4_sitl
#tests, # includes px4_sitl
]
steps:
- uses: actions/checkout@v1
with:
token: ${{secrets.ACCESS_TOKEN}}
- name: setup
run: ./Tools/setup/macos.sh; ./Tools/setup/macos.sh
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
message("::set-output name=timestamp::${current_date}")
- name: ccache cache files
uses: actions/cache@v2
with:
path: ~/.ccache
key: macos_${{matrix.config}}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}}
restore-keys: macos_${{matrix.config}}-ccache-
- name: setup ccache
run: |
mkdir -p ~/.ccache
echo "base_dir = ${GITHUB_WORKSPACE}" > ~/.ccache/ccache.conf
echo "compression = true" >> ~/.ccache/ccache.conf
echo "compression_level = 5" >> ~/.ccache/ccache.conf
echo "max_size = 100M" >> ~/.ccache/ccache.conf
ccache -s
ccache -z
- name: make ${{matrix.config}}
run: |
ccache -z
make ${{matrix.config}}
ccache -s
name: Nuttx Targets
on:
push:
branches:
- 'master'
pull_request:
branches:
- '*'
jobs:
build:
runs-on: ubuntu-latest
container: px4io/px4-dev-nuttx-focal:2021-04-29
strategy:
matrix:
config: [
airmind_mindpx-v2_default,
ark_can-flow_canbootloader,
ark_can-flow_debug,
ark_can-flow_default,
ark_can-gps_canbootloader,
ark_can-gps_debug,
ark_can-gps_default,
av_x-v1_default,
bitcraze_crazyflie21_default,
bitcraze_crazyflie_default,
cuav_can-gps-v1_canbootloader,
cuav_can-gps-v1_debug,
cuav_can-gps-v1_default,
cuav_nora_default,
cuav_x7pro_default,
cubepilot_cubeorange_default,
cubepilot_cubeorange_test,
cubepilot_cubeyellow_default,
cubepilot_cubeyellow_test,
cubepilot_io-v2_default,
freefly_can-rtk-gps_canbootloader,
freefly_can-rtk-gps_default,
holybro_can-gps-v1_canbootloader,
holybro_can-gps-v1_debug,
holybro_can-gps-v1_default,
holybro_durandal-v1_default,
holybro_kakutef7_default,
holybro_pix32v5_default,
modalai_fc-v1_default,
modalai_fc-v1_rtps,
modalai_fc-v2_default,
mro_ctrl-zero-f7-oem_default,
mro_ctrl-zero-f7_default,
mro_ctrl-zero-h7-oem_default,
mro_ctrl-zero-h7_default,
mro_pixracerpro_default,
mro_x21-777_default,
mro_x21_default,
nxp_fmuk66-e_default,
nxp_fmuk66-e_rtps,
nxp_fmuk66-e_socketcan,
nxp_fmuk66-v3_default,
nxp_fmuk66-v3_rtps,
nxp_fmuk66-v3_socketcan,
nxp_fmurt1062-v1_default,
nxp_ucans32k146_canbootloader,
nxp_ucans32k146_default,
omnibus_f4sd_default,
px4_fmu-v2_default,
px4_fmu-v2_fixedwing,
px4_fmu-v2_multicopter,
px4_fmu-v2_rover,
px4_fmu-v3_default,
px4_fmu-v4_cannode,
px4_fmu-v4_default,
px4_fmu-v4pro_default,
px4_fmu-v5_ctrlalloc,
px4_fmu-v5_debug,
px4_fmu-v5_default,
px4_fmu-v5_fixedwing,
px4_fmu-v5_multicopter,
px4_fmu-v5_optimized,
px4_fmu-v5_rover,
px4_fmu-v5_rtps,
px4_fmu-v5_stackcheck,
px4_fmu-v5_uavcanv0periph,
px4_fmu-v5_uavcanv1,
px4_fmu-v5x_base_phy_DP83848C,
px4_fmu-v5x_default,
px4_fmu-v6u_default,
px4_fmu-v6x_default,
px4_io-v2_default,
spracing_h7extreme_default,
uvify_core_default
]
steps:
- uses: actions/checkout@v1
with:
token: ${{secrets.ACCESS_TOKEN}}
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
message("::set-output name=timestamp::${current_date}")
- name: ccache cache files
uses: actions/cache@v2
with:
path: ~/.ccache
key: ${{matrix.config}}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}}
restore-keys: ${{matrix.config}}-ccache-
- name: setup ccache
run: |
mkdir -p ~/.ccache
echo "base_dir = ${GITHUB_WORKSPACE}" > ~/.ccache/ccache.conf
echo "compression = true" >> ~/.ccache/ccache.conf
echo "compression_level = 5" >> ~/.ccache/ccache.conf
echo "max_size = 100M" >> ~/.ccache/ccache.conf
ccache -s
ccache -z
- name: make ${{matrix.config}}
run: make ${{matrix.config}}
- name: make ${{matrix.config}} bloaty_compileunits
run: make ${{matrix.config}} bloaty_compileunits || true
- name: make ${{matrix.config}} bloaty_inlines
run: make ${{matrix.config}} bloaty_inlines || true
- name: make ${{matrix.config}} bloaty_segments
run: make ${{matrix.config}} bloaty_segments || true
- name: make ${{matrix.config}} bloaty_symbols
run: make ${{matrix.config}} bloaty_symbols || true
- name: make ${{matrix.config}} bloaty_templates
run: make ${{matrix.config}} bloaty_templates || true
- name: make ${{matrix.config}} bloaty_ram
run: make ${{matrix.config}} bloaty_ram || true
- name: make ${{matrix.config}} bloaty_compare_master
run: make ${{matrix.config}} bloaty_compare_master || true
- name: ccache post-run
run: ccache -s
- name: Upload px4 package
uses: actions/upload-artifact@v1
with:
name: px4_package_${{matrix.config}}
path: build/${{matrix.config}}/${{matrix.config}}.px4
name: NuttX UAVCAN firmware
on:
push:
branches:
- 'master'
pull_request:
branches:
- '*'
jobs:
build:
runs-on: ubuntu-latest
container: px4io/px4-dev-nuttx-focal:2021-04-29
strategy:
matrix:
config: [
ark_can-flow_default,
cuav_can-gps-v1_default,
freefly_can-rtk-gps_default,
holybro_can-gps-v1_default,
#nxp_ucans32k146_default,
px4_fmu-v4_cannode
]
steps:
- uses: actions/checkout@v1
with:
token: ${{secrets.ACCESS_TOKEN}}
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
message("::set-output name=timestamp::${current_date}")
- name: ccache cache files
uses: actions/cache@v2
with:
path: ~/.ccache
key: ${{matrix.config}}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}}
restore-keys: ${{matrix.config}}-ccache-
- name: setup ccache
run: |
mkdir -p ~/.ccache
echo "base_dir = ${GITHUB_WORKSPACE}" > ~/.ccache/ccache.conf
echo "compression = true" >> ~/.ccache/ccache.conf
echo "compression_level = 5" >> ~/.ccache/ccache.conf
echo "max_size = 100M" >> ~/.ccache/ccache.conf
ccache -s
ccache -z
- name: make ${{matrix.config}}
run: make ${{matrix.config}}
- name: ccache post-run
run: ccache -s
- name: Upload px4 package
uses: actions/upload-artifact@v2
with:
name: px4_cannode_${{matrix.config}}
path: build/${{matrix.config}}/*.uavcan.bin
name: Deploy metadata for all targets
on:
push:
branches:
- 'master'
- 'release/*'
- 'pr-metadata-test'
jobs:
enumerate_targets:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v1
with:
token: ${{secrets.ACCESS_TOKEN}}
- id: set-matrix
run: echo "::set-output name=matrix::$(./Tools/generate_board_targets_json.py)"
build:
runs-on: ubuntu-latest
needs: enumerate_targets
strategy:
matrix: ${{fromJson(needs.enumerate_targets.outputs.matrix)}}
container: px4io/px4-dev-${{ matrix.container }}:2021-04-29
steps:
- uses: actions/checkout@v1
with:
token: ${{secrets.ACCESS_TOKEN}}
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
message("::set-output name=timestamp::${current_date}")
- name: ccache cache files
uses: actions/cache@v2
with:
path: ~/.ccache
key: ${{matrix.target}}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}}
restore-keys: ${{matrix.target}}-ccache-
- name: setup ccache
run: |
mkdir -p ~/.ccache
echo "base_dir = ${GITHUB_WORKSPACE}" > ~/.ccache/ccache.conf
echo "compression = true" >> ~/.ccache/ccache.conf
echo "compression_level = 5" >> ~/.ccache/ccache.conf
echo "max_size = 100M" >> ~/.ccache/ccache.conf
ccache -s
ccache -z
- name: make ${{matrix.target}}
run: make ${{matrix.target}}
- name: ccache post-run
run: ccache -s
- name: parameter metadata
run: |
make ${{matrix.target}} ver_gen
./src/lib/version/get_git_tag_or_branch_version.sh build/${{ matrix.target }} >> $GITHUB_ENV
cd build/${{ matrix.target }}
mkdir _metadata || true
cp parameters.* _metadata
- uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read
env:
AWS_S3_BUCKET: 'px4-travis'
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'us-west-1'
SOURCE_DIR: 'build/${{ matrix.target }}/_metadata/'
DEST_DIR: 'Firmware/${{ env.version }}/${{ matrix.target }}/'
name: MAVROS Mission Tests
on:
push:
branches:
- 'master'
pull_request:
branches:
- '*'
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
config:
- {vehicle: "iris", mission: "MC_mission_box", build_type: "RelWithDebInfo"}
- {vehicle: "rover", mission: "rover_mission_1", build_type: "RelWithDebInfo"}
#- {vehicle: "plane", mission: "FW_mission_1", build_type: "RelWithDebInfo"}
#- {vehicle: "plane_catapult",mission: "FW_mission_1", build_type: "RelWithDebInfo"}
#- {vehicle: "standard_vtol", mission: "VTOL_mission_1", build_type: "Coverage"}
#- {vehicle: "standard_vtol", mission: "VTOL_mission_1", build_type: "AddressSanitizer"}
#- {vehicle: "tailsitter", mission: "VTOL_mission_1", build_type: "RelWithDebInfo"}
#- {vehicle: "tiltrotor", mission: "VTOL_mission_1", build_type: "RelWithDebInfo"}
container:
image: px4io/px4-dev-ros-melodic:2021-04-29
options: --privileged --ulimit core=-1 --security-opt seccomp=unconfined
steps:
- uses: actions/checkout@v1
with:
token: ${{ secrets.ACCESS_TOKEN }}
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
message("::set-output name=timestamp::${current_date}")
- name: ccache cache files
uses: actions/cache@v2
with:
path: ~/.ccache
key: sitl_tests-${{matrix.config.build_type}}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}}
restore-keys: sitl_tests-${{matrix.config.build_type}}-ccache-
- name: setup ccache
run: |
mkdir -p ~/.ccache
echo "base_dir = ${GITHUB_WORKSPACE}" > ~/.ccache/ccache.conf
echo "compression = true" >> ~/.ccache/ccache.conf
echo "compression_level = 5" >> ~/.ccache/ccache.conf
echo "max_size = 100M" >> ~/.ccache/ccache.conf
ccache -s
ccache -z
- name: check environment
run: |
export
ulimit -a
- name: Build PX4 and sitl_gazebo
env:
PX4_CMAKE_BUILD_TYPE: ${{matrix.config.build_type}}
run: |
ccache -z
make px4_sitl_default
make px4_sitl_default sitl_gazebo
ccache -s
- name: Core dump settings
run: |
ulimit -c unlimited
echo "`pwd`/%e.core" > /proc/sys/kernel/core_pattern
- name: Run SITL tests
env:
PX4_CMAKE_BUILD_TYPE: ${{matrix.config.build_type}}
run: |
export
./test/rostest_px4_run.sh mavros_posix_test_mission.test mission:=${{matrix.config.mission}} vehicle:=${{matrix.config.vehicle}}
- name: Look at core files
if: failure()
run: gdb build/px4_sitl_default/bin/px4 px4.core -ex "thread apply all bt" -ex "quit"
- name: Upload px4 coredump
if: failure()
uses: actions/upload-artifact@v2-preview
with:
name: coredump
path: px4.core
- name: ecl EKF analysis
if: always()
run: ./Tools/ecl_ekf/process_logdata_ekf.py ~/.ros/log/*/*.ulg || true
- name: Upload logs to flight review
if: always()
run: ./Tools/upload_log.py -q --description "${GITHUB_WORKFLOW} ${GITHUB_RUN_ID}" --feedback "${GITHUB_WORKFLOW} ${GITHUB_RUN_ID} ${GITHUB_REPOSITORY} ${GITHUB_REF}" --source CI ~/.ros/log/*/*.ulg
- name: Upload px4 binary
if: failure()
uses: actions/upload-artifact@v2
with:
name: binary
path: build/px4_sitl_default/bin/px4
- name: Store PX4 log
if: failure()
uses: actions/upload-artifact@v2
with:
name: px4_log
path: ~/.ros/log/*/*.ulg
- name: Store ROS log
if: failure()
uses: actions/upload-artifact@v2
with:
name: ros_log
path: ~/.ros/**/rostest-*.log
# Report test coverage
- name: Upload coverage
if: contains(matrix.config.build_type, 'Coverage')
run: |
git config --global credential.helper "" # disable the keychain credential helper
git config --global --add credential.helper store # enable the local store credential helper
echo "https://x-access-token:${{ secrets.ACCESS_TOKEN }}@github.com" >> ~/.git-credentials # add credential
git config --global url."https://github.com/".insteadof git@github.com: # credentials add credential
mkdir -p coverage
lcov --directory build/px4_sitl_default --base-directory build/px4_sitl_default --gcov-tool gcov --capture -o coverage/lcov.info
- name: Upload coverage information to Codecov
if: contains(matrix.config.build_type, 'Coverage')
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: mavros_mission
file: coverage/lcov.info
name: MAVROS Offboard Tests
on:
push:
branches:
- 'master'
pull_request:
branches:
- '*'
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
config:
- {test_file: "mavros_posix_tests_offboard_posctl.test", vehicle: "iris", build_type: "RelWithDebInfo"}
#- {test_file: "mavros_posix_tests_offboard_attctl.test", vehicle: "iris", build_type: "RelWithDebInfo"}
#- {test_file: "mavros_posix_tests_offboard_rpyrt_ctl.test", vehicle: "iris", build_type: "RelWithDebInfo"}
container:
image: px4io/px4-dev-ros-melodic:2021-04-29
options: --privileged --ulimit core=-1 --security-opt seccomp=unconfined
steps:
- uses: actions/checkout@v1
with:
token: ${{ secrets.ACCESS_TOKEN }}
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
message("::set-output name=timestamp::${current_date}")
- name: ccache cache files
uses: actions/cache@v2
with:
path: ~/.ccache
key: sitl_tests-${{matrix.config.build_type}}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}}
restore-keys: sitl_tests-${{matrix.config.build_type}}-ccache-
- name: setup ccache
run: |
mkdir -p ~/.ccache
echo "base_dir = ${GITHUB_WORKSPACE}" > ~/.ccache/ccache.conf
echo "compression = true" >> ~/.ccache/ccache.conf
echo "compression_level = 5" >> ~/.ccache/ccache.conf
echo "max_size = 100M" >> ~/.ccache/ccache.conf
ccache -s
ccache -z
- name: check environment
run: |
export
ulimit -a
- name: Build PX4 and sitl_gazebo
env:
PX4_CMAKE_BUILD_TYPE: ${{matrix.config.build_type}}
run: |
ccache -z
make px4_sitl_default
make px4_sitl_default sitl_gazebo
ccache -s
- name: Core dump settings
run: |
ulimit -c unlimited
echo "`pwd`/%e.core" > /proc/sys/kernel/core_pattern
- name: Run SITL tests
env:
PX4_CMAKE_BUILD_TYPE: ${{matrix.config.build_type}}
run: |
export
./test/rostest_px4_run.sh ${{matrix.config.test_file}} vehicle:=${{matrix.config.vehicle}}
- name: Look at core files
if: failure()
run: gdb build/px4_sitl_default/bin/px4 px4.core -ex "thread apply all bt" -ex "quit"
- name: Upload px4 coredump
if: failure()
uses: actions/upload-artifact@v2-preview
with:
name: coredump
path: px4.core
- name: ecl EKF analysis
if: always()
run: ./Tools/ecl_ekf/process_logdata_ekf.py ~/.ros/log/*/*.ulg || true
- name: Upload logs to flight review
if: always()
run: ./Tools/upload_log.py -q --description "${GITHUB_WORKFLOW} ${GITHUB_RUN_ID}" --feedback "${GITHUB_WORKFLOW} ${GITHUB_RUN_ID} ${GITHUB_REPOSITORY} ${GITHUB_REF}" --source CI ~/.ros/log/*/*.ulg
- name: Upload px4 binary
if: failure()
uses: actions/upload-artifact@v2
with:
name: binary
path: build/px4_sitl_default/bin/px4
- name: Store PX4 log
if: failure()
uses: actions/upload-artifact@v2
with:
name: px4_log
path: ~/.ros/log/*/*.ulg
- name: Store ROS log
if: failure()
uses: actions/upload-artifact@v2
with:
name: ros_log
path: ~/.ros/**/rostest-*.log
# Report test coverage
- name: Upload coverage
if: contains(matrix.config.build_type, 'Coverage')
run: |
git config --global credential.helper "" # disable the keychain credential helper
git config --global --add credential.helper store # enable the local store credential helper
echo "https://x-access-token:${{ secrets.ACCESS_TOKEN }}@github.com" >> ~/.git-credentials # add credential
git config --global url."https://github.com/".insteadof git@github.com: # credentials add credential
mkdir -p coverage
lcov --directory build/px4_sitl_default --base-directory build/px4_sitl_default --gcov-tool gcov --capture -o coverage/lcov.info
- name: Upload coverage information to Codecov
if: contains(matrix.config.build_type, 'Coverage')
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: mavros_offboard
file: coverage/lcov.info
name: Metadata
on:
push:
branches:
- 'master'
- 'release/*'
- 'pr-metadata-test'
jobs:
airframe:
runs-on: ubuntu-latest
container: px4io/px4-dev-base-focal:2021-04-29
steps:
- uses: actions/checkout@v1
with:
token: ${{ secrets.ACCESS_TOKEN }}
- name: airframe metadata
run: |
make airframe_metadata
cd build/px4_sitl_default/docs
ls -ls *
# TODO: deploy to userguide gitbook and s3
module:
runs-on: ubuntu-latest
container: px4io/px4-dev-base-focal:2021-04-29
steps:
- uses: actions/checkout@v1
with:
token: ${{ secrets.ACCESS_TOKEN }}
- name: module documentation
run: |
make module_documentation
cd build/px4_sitl_default/docs
ls -ls *
# TODO: deploy to userguide gitbook and s3
parameter:
runs-on: ubuntu-latest
container: px4io/px4-dev-base-focal:2021-04-29
steps:
- uses: actions/checkout@v1
with:
token: ${{ secrets.ACCESS_TOKEN }}
- name: parameter metadata
run: |
make parameters_metadata
./src/lib/version/get_git_tag_or_branch_version.sh build/px4_sitl_default >> $GITHUB_ENV
- uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read
env:
AWS_S3_BUCKET: 'px4-travis'
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'us-west-1'
SOURCE_DIR: 'build/px4_sitl_default/docs/'
DEST_DIR: 'Firmware/${{ env.version }}/_general/'
uorb_graph:
runs-on: ubuntu-latest
container: px4io/px4-dev-nuttx-focal:2021-04-29
steps:
- uses: actions/checkout@v1
with:
token: ${{ secrets.ACCESS_TOKEN }}
- name: uORB graph
run: |
make uorb_graphs
cd Tools/uorb_graph
ls -ls *
# TODO: deploy graph_px4_sitl.json to S3 px4-travis:Firmware/master/
micrortps_agent:
runs-on: ubuntu-latest
container: px4io/px4-dev-base-focal:2021-04-29
steps:
- uses: actions/checkout@v1
with:
token: ${{ secrets.ACCESS_TOKEN }}
- name: microRTPS agent
run: |
make px4_sitl_rtps
git clone https://github.com/PX4/micrortps_agent.git
cp -R build/px4_sitl_rtps/src/modules/micrortps_bridge/micrortps_agent/* micrortps_agent
ROS_msgs:
runs-on: ubuntu-latest
container: px4io/px4-dev-base-focal:2021-04-29
steps:
- uses: actions/checkout@v1
with:
token: ${{ secrets.ACCESS_TOKEN }}
- name: PX4 ROS msgs
run: |
git clone https://github.com/PX4/px4_msgs.git
python3 msg/tools/uorb_to_ros_msgs.py msg/ px4_msgs/msg/
ROS2_bridge:
runs-on: ubuntu-latest
container: px4io/px4-dev-base-focal:2021-04-29
steps:
- uses: actions/checkout@v1
with:
token: ${{ secrets.ACCESS_TOKEN }}
- name: PX4 ROS2 bridge
run: |
git clone https://github.com/PX4/px4_ros_com.git
./msg/tools/uorb_to_ros_rtps_ids.py -i msg/tools/uorb_rtps_message_ids.yaml -o px4_ros_com/templates/uorb_rtps_message_ids.yaml
name: Python CI Checks
on:
push:
branches:
- 'master'
pull_request:
branches:
- '*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
with:
token: ${{ secrets.ACCESS_TOKEN }}
- name: Install Python3
run: sudo apt-get install python3 python3-setuptools python3-pip -y
- name: Install tools
run: pip3 install --user mypy flake8
- name: Check MAVSDK test scripts with mypy
run: $HOME/.local/bin/mypy --strict test/mavsdk_tests/*.py
- name: Check MAVSDK test scripts with flake8
run: $HOME/.local/bin/flake8 test/mavsdk_tests/*.py
name: SITL Tests
on:
push:
branches:
- 'master'
pull_request:
branches:
- '*'
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
config:
- {latitude: "59.617693", longitude: "-151.145316", altitude: "48", build_type: "RelWithDebInfo", model: "iris" } # Alaska
- {latitude: "-38.071235", longitude: "145.281220", altitude: "31", build_type: "RelWithDebInfo", model: "standard_vtol" } # Australia
- {latitude: "29.660316", longitude: "-82.316658", altitude: "30", build_type: "RelWithDebInfo", model: "tailsitter" } # Florida
- {latitude: "47.397742", longitude: "8.545594", altitude: "488", build_type: "Coverage", model: "standard_vtol" } # Zurich
container:
image: px4io/px4-dev-simulation-focal:2021-04-29
options: --privileged --ulimit core=-1 --security-opt seccomp=unconfined
steps:
- uses: actions/checkout@v1
with:
token: ${{ secrets.ACCESS_TOKEN }}
- name: Download MAVSDK
run: wget "https://github.com/mavlink/MAVSDK/releases/download/v$(cat test/mavsdk_tests/MAVSDK_VERSION)/mavsdk_$(cat test/mavsdk_tests/MAVSDK_VERSION)_ubuntu20.04_amd64.deb"
- name: Install MAVSDK
run: dpkg -i "mavsdk_$(cat test/mavsdk_tests/MAVSDK_VERSION)_ubuntu20.04_amd64.deb"
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
message("::set-output name=timestamp::${current_date}")
- name: ccache cache files
uses: actions/cache@v2
with:
path: ~/.ccache
key: sitl_tests-${{matrix.config.build_type}}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}}
restore-keys: sitl_tests-${{matrix.config.build_type}}-ccache-
- name: setup ccache
run: |
mkdir -p ~/.ccache
echo "base_dir = ${GITHUB_WORKSPACE}" > ~/.ccache/ccache.conf
echo "compression = true" >> ~/.ccache/ccache.conf
echo "compression_level = 5" >> ~/.ccache/ccache.conf
echo "max_size = 100M" >> ~/.ccache/ccache.conf
ccache -s
ccache -z
- name: check environment
env:
PX4_HOME_LAT: ${{matrix.config.latitude}}
PX4_HOME_LON: ${{matrix.config.longitude}}
PX4_HOME_ALT: ${{matrix.config.altitude}}
PX4_CMAKE_BUILD_TYPE: ${{matrix.config.build_type}}
run: |
export
ulimit -a
- name: Build PX4
env:
PX4_CMAKE_BUILD_TYPE: ${{matrix.config.build_type}}
run: make px4_sitl_default
- name: ccache post-run px4/firmware
run: ccache -s
- name: Build SITL Gazebo
env:
PX4_CMAKE_BUILD_TYPE: ${{matrix.config.build_type}}
run: make px4_sitl_default sitl_gazebo
- name: ccache post-run sitl_gazebo
run: ccache -s
- name: Build MAVSDK tests
env:
PX4_CMAKE_BUILD_TYPE: ${{matrix.config.build_type}}
DONT_RUN: 1
run: make px4_sitl_default gazebo mavsdk_tests
- name: ccache post-run mavsdk_tests
run: ccache -s
- name: Core dump settings
run: |
ulimit -c unlimited
echo "`pwd`/%e.core" > /proc/sys/kernel/core_pattern
- name: Run SITL tests
env:
PX4_HOME_LAT: ${{matrix.config.latitude}}
PX4_HOME_LON: ${{matrix.config.longitude}}
PX4_HOME_ALT: ${{matrix.config.altitude}}
PX4_CMAKE_BUILD_TYPE: ${{matrix.config.build_type}}
run: test/mavsdk_tests/mavsdk_test_runner.py --speed-factor 20 --abort-early --model ${{matrix.config.model}} --upload test/mavsdk_tests/configs/sitl.json
- name: Look at core files
if: failure()
run: gdb build/px4_sitl_default/bin/px4 px4.core -ex "thread apply all bt" -ex "quit"
- name: Upload px4 coredump
if: failure()
uses: actions/upload-artifact@v2-preview
with:
name: coredump
path: px4.core
- name: Upload px4 binary
if: failure()
uses: actions/upload-artifact@v2-preview
with:
name: binary
path: build/px4_sitl_default/bin/px4
# Report test coverage
- name: Upload coverage
if: contains(matrix.config.build_type, 'Coverage')
run: |
git config --global credential.helper "" # disable the keychain credential helper
git config --global --add credential.helper store # enable the local store credential helper
echo "https://x-access-token:${{ secrets.ACCESS_TOKEN }}@github.com" >> ~/.git-credentials # add credential
git config --global url."https://github.com/".insteadof git@github.com: # credentials add credential
mkdir -p coverage
lcov --directory build/px4_sitl_default --base-directory build/px4_sitl_default --gcov-tool gcov --capture -o coverage/lcov.info
- name: Upload coverage information to Codecov
if: contains(matrix.config.build_type, 'Coverage')
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: mavsdk
file: coverage/lcov.info
# How to install:
# gem install github_changelog_generator
# How to run:
# github_changelog_generator -u PX4 -p Firmware
# Description:
# The following params are sensible defaults for the PX4 project,
# if you want to do a changelog before a release you need to update since-tag and future-releases,
# Params:
# github_changelog_generator --help for all options
# max-issues
# max threshold for github api queries
# make sure you set your CHANGELOG_GITHUB_TOKEN before
# running
max-issues=1500
# exclude-tags-regex
# excludes release candidates
exclude-tags-regex=rc[0-9]{1,}|beta[0-9]{1,}
# since-tag
# version of last stable release
# you need to change this depending on what you need
# if you want a changelog between versions this is the lowest version
since-tag=1.6.5
# future-release
# version you are about to release
# if you want a changelog between a version and all unreleased changes grouped as a release
# eg: v1.6.5 to v1.7.0
future-release=v1.7.0
*.dSYM
*.o
*.gch
*.pyc
*~
.*.swp
.context
.cproject
.DS_Store
.gdbinit
.gdb_history
.project
.settings
.swp
.~lock.*
Testing/
Packages/*
build/*
build_*/
cscope.out
cscope.in.out
cscope.po.out
Firmware.sublime-workspace
user.sublime*
/Documentation/doxy.log
/Documentation/html/
/Documentation/doxygen*objdb*tmp
.tags
tags
.tags_sorted_by_file
.pydevproject
.ropeproject
*.orig
Firmware.zip
*.generated.h
.vagrant
*.pretty
xcode
rootfs/
*.autosave
CMakeLists.txt.user
GPATH
GRTAGS
GTAGS
*.creator
*.creator.user
*.files
*.includes
# CLion ignores
.idea
cmake-build-*/
posix-configs/SITL/init/test/*_generated
/airframes.md
/airframes.xml
/parameters.md
/parameters.xml
/modules
/msg/ros/*.msg
*.gcov
.coverage
.coverage.*
# KDevelop ignores
.kdev4/*
*.kdev4
# cmake in tree (ninja)
.ninja_deps
.ninja_log
bin/
build.ninja
cmake_install.cmake
CMakeCache.txt
CMakeFiles
compile_commands.json
CPackConfig.cmake
CPackSourceConfig.cmake
CTestTestfile.cmake
external/
rules.ninja
# in tree build
**/*.a
**/*.px4mod
**/*.stamp
/coverage*
/functional-*
/generated_params/
/googletest-*/
/logs
/mavsdk_tests
/test_mixer_multirotor
/unit-*
/uORB/
DartConfiguration.tcl
msg/tmp/
msg/topics_sources/
platforms/posix/apps.cpp
platforms/posix/apps.h
src/lib/version/build_git_version.h
src/modules/simulator/simulator_config.h
src/systemcmds/topic_listener/listener_generated.cpp
# SITL
dataman
eeprom/
[submodule "mavlink/include/mavlink/v2.0"]
path = mavlink/include/mavlink/v2.0
url = https://github.com/mavlink/c_library_v2.git
branch = master
[submodule "src/drivers/uavcan/libuavcan"]
path = src/drivers/uavcan/libuavcan
url = https://github.com/PX4/libuavcan.git
branch = px4
[submodule "Tools/jMAVSim"]
path = Tools/jMAVSim
url = https://github.com/PX4/jMAVSim.git
branch = master
[submodule "Tools/sitl_gazebo"]
path = Tools/sitl_gazebo
url = https://github.com/PX4/PX4-SITL_gazebo.git
branch = master
[submodule "src/lib/matrix"]
path = src/lib/matrix
url = https://github.com/PX4/PX4-Matrix.git
branch = master
[submodule "src/lib/ecl"]
path = src/lib/ecl
url = https://github.com/PX4/PX4-ECL.git
branch = master
[submodule "boards/atlflight/cmake_hexagon"]
path = boards/atlflight/cmake_hexagon
url = https://github.com/PX4/cmake_hexagon.git
branch = px4
[submodule "src/drivers/gps/devices"]
path = src/drivers/gps/devices
url = https://github.com/PX4/PX4-GPSDrivers.git
branch = master
[submodule "src/modules/micrortps_bridge/micro-CDR"]
path = src/modules/micrortps_bridge/micro-CDR
url = https://github.com/PX4/Micro-CDR.git
branch = master
[submodule "platforms/nuttx/NuttX/nuttx"]
path = platforms/nuttx/NuttX/nuttx
url = https://github.com/PX4/NuttX.git
branch = px4_firmware_nuttx-10.0.0+
[submodule "platforms/nuttx/NuttX/apps"]
path = platforms/nuttx/NuttX/apps
url = https://github.com/PX4/NuttX-apps.git
branch = px4_firmware_nuttx-10.0.0+
[submodule "platforms/qurt/dspal"]
path = platforms/qurt/dspal
url = https://github.com/ATLFlight/dspal.git
[submodule "Tools/flightgear_bridge"]
path = Tools/flightgear_bridge
url = https://github.com/PX4/PX4-FlightGear-Bridge.git
[submodule "Tools/jsbsim_bridge"]
path = Tools/jsbsim_bridge
url = https://github.com/PX4/px4-jsbsim-bridge.git
[submodule "src/drivers/uavcan_v1/libcanard"]
path = src/drivers/uavcan_v1/libcanard
url = https://github.com/UAVCAN/libcanard.git
[submodule "src/drivers/uavcan_v1/public_regulated_data_types"]
path = src/drivers/uavcan_v1/public_regulated_data_types
url = https://github.com/UAVCAN/public_regulated_data_types.git
[submodule "src/drivers/uavcannode_gps_demo/public_regulated_data_types"]
path = src/drivers/uavcannode_gps_demo/public_regulated_data_types
url = https://github.com/UAVCAN/public_regulated_data_types.git
[submodule "src/drivers/uavcannode_gps_demo/libcanard"]
path = src/drivers/uavcannode_gps_demo/libcanard
url = https://github.com/UAVCAN/libcanard.git
[submodule "src/drivers/uavcan_v1/legacy_data_types"]
path = src/drivers/uavcan_v1/legacy_data_types
url = https://github.com/PX4/public_regulated_data_types.git
branch = legacy
language: cpp
git:
depth: 100
submodules: false
matrix:
fast_finish: true
include:
- os: linux
dist: xenial
# In order to stay under the coverity rate limit, we only run this weekly
# and not on push which is configured in travis-ci settings.
if: branch = master
before_install:
- echo -n | openssl s_client -connect scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-
install:
- export PATH=$HOME/.local/bin:$PATH
- pip install --user --upgrade pip
- pip install --user -r Tools/setup/requirements.txt
script:
- make
addons:
coverity_scan:
project:
name: "PX4/Firmware"
description: "Build submitted via Travis CI"
notification_email: ci@px4.io
build_command_prepend: "make distclean"
build_command: "make px4_sitl_default"
branch_pattern: coverity_scan
.cortex-debug.peripherals.state.json
.cortex-debug.registers.state.json
compile_commands.json
# generated by cmake
launch.json
# C/C++ extension does some local caching in this folder
ipch/
browse.vc.db*
{
"configurations": [
{
"name": "PX4",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [],
"macFrameworkPath": [],
"configurationProvider": "ms-vscode.cmake-tools",
"cppStandard": "c++14",
"cStandard": "c11"
}
],
"version": 4
}
\ No newline at end of file
[
{
"name": "PX4 detect"
}
]
\ No newline at end of file
CONFIG:
default: px4_sitl_default
choices:
px4_sitl_default:
short: px4_sitl
buildType: RelWithDebInfo
settings:
CONFIG: px4_sitl_default
px4_sitl_replay:
short: px4_sitl_replay
buildType: RelWithDebInfo
settings:
CONFIG: px4_sitl_replay
px4_sitl_test:
short: px4_sitl_test
buildType: RelWithDebInfo
settings:
CONFIG: px4_sitl_test
px4_io-v2_default:
short: px4_io-v2
buildType: MinSizeRel
settings:
CONFIG: px4_io-v2_default
px4_fmu-v2_default:
short: px4_fmu-v2
buildType: MinSizeRel
settings:
CONFIG: px4_fmu-v2_default
px4_fmu-v3_default:
short: px4_fmu-v3
buildType: MinSizeRel
settings:
CONFIG: px4_fmu-v3_default
px4_fmu-v4_default:
short: px4_fmu-v4
buildType: MinSizeRel
settings:
CONFIG: px4_fmu-v4_default
px4_fmu-v4pro_default:
short: px4_fmu-v4pro
buildType: MinSizeRel
settings:
CONFIG: px4_fmu-v4pro_default
px4_fmu-v5_default:
short: px4_fmu-v5
buildType: MinSizeRel
settings:
CONFIG: px4_fmu-v5_default
px4_fmu-v5x_default:
short: px4_fmu-v5x
buildType: MinSizeRel
settings:
CONFIG: px4_fmu-v5x_default
airmind_mindpx-v2_default:
short: airmind_mindpx-v2
buildType: MinSizeRel
settings:
CONFIG: airmind_mindpx-v2_default
ark_can-flow_default:
short: ark_can-flow_default
buildType: MinSizeRel
settings:
CONFIG: ark_can-flow_default
ark_can-flow_canbootloader:
short: ark_can-flow_canbootloader
buildType: MinSizeRel
settings:
CONFIG: ark_can-flow_canbootloader
ark_can-gps_default:
short: ark_can-gps_default
buildType: MinSizeRel
settings:
CONFIG: ark_can-gps_default
ark_can-gps_canbootloader:
short: ark_can-gps_canbootloader
buildType: MinSizeRel
settings:
CONFIG: ark_can-gps_canbootloader
av_x-v1_default:
short: av_x-v1
buildType: MinSizeRel
settings:
CONFIG: av_x-v1_default
bitcraze_crazyflie_default:
short: bitcraze_crazyflie
buildType: MinSizeRel
settings:
CONFIG: bitcraze_crazyflie_default
cuav_can-gps-v1_default:
short: cuav_can-gps-v1_default
buildType: MinSizeRel
settings:
CONFIG: cuav_can-gps-v1_default
cuav_can-gps-v1_canbootloader:
short: cuav_can-gps-v1_canbootloader
buildType: MinSizeRel
settings:
CONFIG: cuav_can-gps-v1_canbootloader
cuav_nora_default:
short: cuav_nora
buildType: MinSizeRel
settings:
CONFIG: cuav_nora_default
cuav_x7pro_default:
short: cuav_x7pro
buildType: MinSizeRel
settings:
CONFIG: cuav_x7pro_default
cubepilot_cubeorange_test:
short: cubepilot_cubeorange
buildType: MinSizeRel
settings:
CONFIG: cubepilot_orange_test
emlid_navio2_default:
short: emlid_navio2
buildType: MinSizeRel
settings:
CONFIG: emlid_navio2_default
freefly_can-rtk-gps_default:
short: freefly_can-rtk-gps_default
buildType: MinSizeRel
settings:
CONFIG: freefly_can-rtk-gps_default
freefly_can-rtk-gps_canbootloader:
short: freefly_can-rtk-gps_canbootloader
buildType: MinSizeRel
settings:
CONFIG: freefly_can-rtk-gps_canbootloader
holybro_can-gps-v1_canbootloader:
short: holybro_can-gps-v1_canbootloader
buildType: MinSizeRel
settings:
CONFIG: holybro_can-gps-v1_canbootloader
holybro_can-gps-v1_default:
short: holybro_can-gps-v1_default
buildType: MinSizeRel
settings:
CONFIG: holybro_can-gps-v1_default
holybro_durandal-v1_default:
short: holybro_durandal-v1
buildType: MinSizeRel
settings:
CONFIG: holybro_durandal-v1_default
modalai_fc-v1_default:
short: modalai_fc-v1
buildType: MinSizeRel
settings:
CONFIG: modalai_fc-v1_default
modalai_fc-v2_default:
short: modalai_fc-v2
buildType: MinSizeRel
settings:
CONFIG: modalai_fc-v2_default
mro_ctrl-zero-f7_default:
short: mro_ctrl-zero-f7
buildType: MinSizeRel
settings:
CONFIG: mro_ctrl-zero-f7_default
mro_pixracerpro_bootloader:
short: mro_pixracerpro_bootloader
buildType: MinSizeRel
settings:
CONFIG: mro_pixracerpro_bootloader
mro_pixracerpro_default:
short: mro_pixracerpro_default
buildType: MinSizeRel
settings:
CONFIG: mro_pixracerpro_default
mro_x21-777_default:
short: mro_x2.1-777
buildType: MinSizeRel
settings:
CONFIG: mro_x21-777_default
nxp_fmuk66-v3_default:
short: nxp_fmuk66-v3
buildType: MinSizeRel
settings:
CONFIG: nxp_fmuk66-v3_default
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"chiehyu.vscode-astyle",
"dan-c-underwood.arm",
"fredericbonnet.cmake-test-adapter",
"github.vscode-pull-request-github",
"marus25.cortex-debug",
"ms-azuretools.vscode-docker",
"ms-iot.vscode-ros",
"ms-python.python",
"ms-vscode.cmake-tools",
"ms-vscode.cpptools",
"ms-vscode.cpptools-extension-pack",
"redhat.vscode-yaml",
"streetsidesoftware.code-spell-checker",
"twxs.cmake",
"uavcan.dsdl",
"wholroyd.jinja",
"zixuanwang.linkerscript"
]
}
{
"astyle.astylerc": "${workspaceFolder}/Tools/astyle/astylerc",
"astyle.c.enable": true,
"astyle.cpp.enable": true,
"breadcrumbs.enabled": true,
"C_Cpp.autoAddFileAssociations": false,
"C_Cpp.clang_format_fallbackStyle": "none",
"C_Cpp.default.browse.limitSymbolsToIncludedHeaders": true,
"C_Cpp.default.cppStandard": "c++14",
"C_Cpp.default.cStandard": "c11",
"C_Cpp.formatting": "Disabled",
"C_Cpp.intelliSenseEngine": "Default",
"C_Cpp.vcpkg.enabled": false,
"C_Cpp.workspaceParsingPriority": "low",
"cmake.buildBeforeRun": true,
"cmake.buildDirectory": "${workspaceFolder}/build/${variant:CONFIG}",
"cmake.buildTask": true,
"cmake.configureOnOpen": true,
"cmake.ctest.parallelJobs": 1,
"cmake.skipConfigureIfCachePresent": true,
"cmakeExplorer.buildDir": "${workspaceFolder}/build/px4_sitl_test",
"cmakeExplorer.parallelJobs": 1,
"cmakeExplorer.suiteDelimiter": "-",
"cortex-debug.enableTelemetry": false,
"cSpell.allowCompoundWords": true,
"cSpell.diagnosticLevel": "Hint",
"cSpell.showStatus": false,
"cSpell.words": [
"acro",
"nuttx",
"esc"
],
"debug.toolBarLocation": "docked",
"editor.acceptSuggestionOnEnter": "off",
"editor.defaultFormatter": "chiehyu.vscode-astyle",
"editor.dragAndDrop": false,
"editor.insertSpaces": false,
"editor.minimap.maxColumn": 120,
"editor.minimap.renderCharacters": false,
"editor.minimap.showSlider": "always",
"editor.suggest.localityBonus": true,
"editor.tabSize": 8,
"editor.wordWrapColumn": 120,
"explorer.openEditors.visible": 0,
"files.insertFinalNewline": true,
"files.trimTrailingWhitespace": true,
"files.watcherExclude": {
"**/build/**": true
},
"git.detectSubmodulesLimit": 20,
"git.ignoreLimitWarning": true,
"githubPullRequests.defaultMergeMethod": "squash",
"githubPullRequests.telemetry.enabled": false,
"files.associations": {
"*.jinja": "jinja",
"algorithm": "cpp",
"array": "cpp",
"atomic": "cpp",
"bitset": "cpp",
"cctype": "cpp",
"cfenv": "cpp",
"chrono": "cpp",
"cinttypes": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"codecvt": "cpp",
"complex": "cpp",
"condition_variable": "cpp",
"csignal": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdint": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"deque": "cpp",
"exception": "cpp",
"forward_list": "cpp",
"fstream": "cpp",
"functional": "cpp",
"future": "cpp",
"hash_map": "cpp",
"hash_set": "cpp",
"initializer_list": "cpp",
"iomanip": "cpp",
"iosfwd": "cpp",
"iostream": "cpp",
"istream": "cpp",
"iterator": "cpp",
"limits": "cpp",
"list": "cpp",
"map": "cpp",
"memory": "cpp",
"memory_resource": "cpp",
"mutex": "cpp",
"new": "cpp",
"numeric": "cpp",
"optional": "cpp",
"ostream": "cpp",
"random": "cpp",
"ratio": "cpp",
"regex": "cpp",
"set": "cpp",
"sstream": "cpp",
"stdexcept": "cpp",
"streambuf": "cpp",
"string": "cpp",
"string_view": "cpp",
"strstream": "cpp",
"system_error": "cpp",
"thread": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"typeindex": "cpp",
"typeinfo": "cpp",
"unordered_map": "cpp",
"unordered_set": "cpp",
"utility": "cpp",
"valarray": "cpp",
"variant": "cpp",
"vector": "cpp"
},
"search.exclude": {
"${workspaceFolder}/build": true
},
"search.showLineNumbers": true,
"telemetry.enableTelemetry": false,
"terminal.integrated.copyOnSelection": true,
"terminal.integrated.rightClickBehavior": "paste",
"terminal.integrated.scrollback": 5000,
"window.title": "${dirty} ${activeEditorMedium}${separator}${rootName}",
"workbench.editor.highlightModifiedTabs": true,
"workbench.enableExperiments": false,
"workbench.settings.enableNaturalLanguageSearch": false,
"yaml.schemas": {
"${workspaceFolder}/validation/module_schema.yaml": "${workspaceFolder}/src/modules/*/module.yaml"
}
}
This diff is collapsed. Click to expand it.
# This file is NOT licensed under the GPLv3, which is the license for the rest
# of YouCompleteMe.
#
# Here's the license text for this file:
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any purpose, commercial or non-commercial, and by any
# means.
#
# In jurisdictions that recognize copyright laws, the author or authors
# of this software dedicate any and all copyright interest in the
# software to the public domain. We make this dedication for the benefit
# of the public at large and to the detriment of our heirs and
# successors. We intend this dedication to be an overt act of
# relinquishment in perpetuity of all present and future rights to this
# software under copyright law.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
#
# For more information, please refer to <http://unlicense.org/>
import os
import ycm_core
# These are the compilation flags that will be used in case there's no
# compilation database set (by default, one is not set).
# CHANGE THIS LIST OF FLAGS. YES, THIS IS THE DROID YOU HAVE BEEN LOOKING FOR.
flags = [
'-Wall',
'-Wextra',
'-Werror',
#'-Wc++98-compat',
'-Wno-long-long',
'-Wno-variadic-macros',
'-fexceptions',
'-DNDEBUG',
# You 100% do NOT need -DUSE_CLANG_COMPLETER in your flags; only the YCM
# source code needs it.
#'-DUSE_CLANG_COMPLETER',
# THIS IS IMPORTANT! Without a "-std=<something>" flag, clang won't know which
# language to use when compiling headers. So it will guess. Badly. So C++
# headers will be compiled as C headers. You don't want that so ALWAYS specify
# a "-std=<something>".
# For a C project, you would set this to something like 'c99' instead of
# 'c++14'.
'-std=c++14',
# ...and the same thing goes for the magic -x option which specifies the
# language that the files to be compiled are written in. This is mostly
# relevant for c++ headers.
# For a C project, you would set this to 'c' instead of 'c++'.
'-x',
'c++',
'-undef', # get rid of standard definitions to allow us to include arm math header
'-I', os.path.join(os.path.expanduser("~"),'gcc-arm-none-eabi-4_7-2013q3/arm-none-eabi/include'),
'-I', 'Build/px4_io-v2_default.build/nuttx-export/include/',
'-I', './NuttX/nuttx/arch/arm/include',
'-include', './src/include/visibility.h',
'-I', './src',
'-I', './src/modules',
'-I', './src/include',
'-I', './src/lib',
'-I', './NuttX',
]
# Set this to the absolute path to the folder (NOT the file!) containing the
# compile_commands.json file to use that instead of 'flags'. See here for
# more details: http://clang.llvm.org/docs/JSONCompilationDatabase.html
#
# Most projects will NOT need to set this to anything; you can just change the
# 'flags' list of compilation flags. Notice that YCM itself uses that approach.
compilation_database_folder = ''
if os.path.exists( compilation_database_folder ):
database = ycm_core.CompilationDatabase( compilation_database_folder )
else:
database = None
SOURCE_EXTENSIONS = [ '.cpp', '.cxx', '.cc', '.c', '.m', '.mm' ]
def DirectoryOfThisScript():
return os.path.dirname( os.path.abspath( __file__ ) )
def MakeRelativePathsInFlagsAbsolute( flags, working_directory ):
if not working_directory:
return list( flags )
new_flags = []
make_next_absolute = False
path_flags = [ '-isystem', '-I', '-iquote', '--sysroot=' ]
for flag in flags:
new_flag = flag
if make_next_absolute:
make_next_absolute = False
if not flag.startswith( '/' ):
new_flag = os.path.join( working_directory, flag )
for path_flag in path_flags:
if flag == path_flag:
make_next_absolute = True
break
if flag.startswith( path_flag ):
path = flag[ len( path_flag ): ]
new_flag = path_flag + os.path.join( working_directory, path )
break
if new_flag:
new_flags.append( new_flag )
return new_flags
def IsHeaderFile( filename ):
extension = os.path.splitext( filename )[ 1 ]
return extension in [ '.h', '.hxx', '.hpp', '.hh' ]
def GetCompilationInfoForFile( filename ):
# The compilation_commands.json file generated by CMake does not have entries
# for header files. So we do our best by asking the db for flags for a
# corresponding source file, if any. If one exists, the flags for that file
# should be good enough.
if IsHeaderFile( filename ):
basename = os.path.splitext( filename )[ 0 ]
for extension in SOURCE_EXTENSIONS:
replacement_file = basename + extension
if os.path.exists( replacement_file ):
compilation_info = database.GetCompilationInfoForFile(
replacement_file )
if compilation_info.compiler_flags_:
return compilation_info
return None
return database.GetCompilationInfoForFile( filename )
def FlagsForFile( filename, **kwargs ):
if database:
# Bear in mind that compilation_info.compiler_flags_ does NOT return a
# python list, but a "list-like" StringVec object
compilation_info = GetCompilationInfoForFile( filename )
if not compilation_info:
return None
final_flags = MakeRelativePathsInFlagsAbsolute(
compilation_info.compiler_flags_,
compilation_info.compiler_working_dir_ )
# NOTE: This is just for YouCompleteMe; it's highly likely that your project
# does NOT need to remove the stdlib flag. DO NOT USE THIS IN YOUR
# ycm_extra_conf IF YOU'RE NOT 100% SURE YOU NEED IT.
#try:
# final_flags.remove( '-stdlib=libc++' )
#except ValueError:
# pass
else:
relative_to = DirectoryOfThisScript()
final_flags = MakeRelativePathsInFlagsAbsolute( flags, relative_to )
return {
'flags': final_flags,
'do_cache': True
}
--ignore-dir=Documentation
#!/usr/bin/env groovy
pipeline {
agent none
stages {
stage('Build') {
steps {
script {
def build_nodes = [:]
def docker_images = [
armhf: "px4io/px4-dev-armhf:2021-04-29",
arm64: "px4io/px4-dev-aarch64:2021-04-29",
base: "px4io/px4-dev-base-bionic:2021-04-29",
nuttx: "px4io/px4-dev-nuttx-focal:2021-04-29",
snapdragon: "lorenzmeier/px4-dev-snapdragon:2020-04-01"
]
def armhf_builds = [
target: ["beaglebone_blue_default", "emlid_navio2_default", "px4_raspberrypi_default", "scumaker_pilotpi_default"],
image: docker_images.armhf,
archive: false
]
def arm64_builds = [
target: ["scumaker_pilotpi_arm64"],
image: docker_images.arm64,
archive: false
]
def base_builds = [
target: ["px4_sitl_rtps"],
image: docker_images.base,
archive: false
]
def nuttx_builds_archive = [
target: [
"airmind_mindpx-v2_default",
"ark_can-flow_canbootloader",
"ark_can-flow_default",
"av_x-v1_default",
"bitcraze_crazyflie_default",
"bitcraze_crazyflie21_default",
"cuav_can-gps-v1_canbootloader",
"cuav_can-gps-v1_default",
"cuav_nora_default",
"cuav_x7pro_default",
"cubepilot_cubeorange_default",
"cubepilot_cubeyellow_default",
"freefly_can-rtk-gps_canbootloader",
"freefly_can-rtk-gps_default",
"holybro_can-gps-v1_canbootloader",
"holybro_can-gps-v1_default",
"holybro_durandal-v1_default",
"holybro_kakutef7_default",
"holybro_pix32v5_default",
"modalai_fc-v1_default",
"modalai_fc-v1_rtps",
"modalai_fc-v2_default",
"mro_ctrl-zero-f7_default",
"mro_ctrl-zero-f7-oem_default",
"mro_ctrl-zero-h7_default",
"mro_ctrl-zero-h7-oem_default",
"mro_pixracerpro_default",
"mro_x21-777_default",
"mro_x21_default",
"nxp_fmuk66-e_default",
"nxp_fmuk66-e_rtps",
"nxp_fmuk66-e_socketcan",
"nxp_fmuk66-v3_default",
"nxp_fmuk66-v3_rtps",
"nxp_fmuk66-v3_socketcan",
"nxp_fmurt1062-v1_default",
"nxp_ucans32k146_default",
"nxp_ucans32k146_canbootloader",
"omnibus_f4sd_default",
"px4_fmu-v2_default",
"px4_fmu-v2_fixedwing",
"px4_fmu-v2_multicopter",
"px4_fmu-v2_rover",
"px4_fmu-v3_default",
"px4_fmu-v4_cannode",
"px4_fmu-v4_default",
"px4_fmu-v4pro_default",
"px4_fmu-v5_ctrlalloc",
"px4_fmu-v5_debug",
"px4_fmu-v5_default",
"px4_fmu-v5_fixedwing",
"px4_fmu-v5_multicopter",
"px4_fmu-v5_optimized",
"px4_fmu-v5_rover",
"px4_fmu-v5_rtps",
"px4_fmu-v5_stackcheck",
"px4_fmu-v5_uavcanv0periph",
"px4_fmu-v5_uavcanv1",
"px4_fmu-v5x_base_phy_DP83848C",
"px4_fmu-v5x_default",
"px4_fmu-v6u_default",
"px4_fmu-v6x_default",
"px4_io-v2_default",
"spracing_h7extreme_default",
"uvify_core_default"
],
image: docker_images.nuttx,
archive: true
]
def snapdragon_builds = [
target: ["atlflight_eagle_qurt", "atlflight_eagle_default"],
image: docker_images.snapdragon,
archive: false
]
def docker_builds = [
armhf_builds, base_builds, nuttx_builds_archive//, snapdragon_builds
]
for (def build_type = 0; build_type < docker_builds.size(); build_type++) {
for (def build_target = 0; build_target < docker_builds[build_type].target.size(); build_target++) {
build_nodes.put(docker_builds[build_type].target[build_target],
createBuildNode(docker_builds[build_type].archive, docker_builds[build_type].image, docker_builds[build_type].target[build_target])
)
}
}
parallel build_nodes
} // script
} // steps
} // stage Build
// TODO: actually upload artifacts to S3
// stage('S3 Upload') {
// agent {
// docker { image 'px4io/px4-dev-base-focal:2021-04-29' }
// }
// options {
// skipDefaultCheckout()
// }
// when {
// anyOf {
// branch 'master'
// branch 'beta'
// branch 'stable'
// branch 'pr-jenkins' // for testing
// }
// }
// steps {
// sh 'echo "uploading to S3"'
// }
// }
} // stages
environment {
CCACHE_DIR = '/tmp/ccache'
CI = true
}
options {
buildDiscarder(logRotator(numToKeepStr: '5', artifactDaysToKeepStr: '14'))
timeout(time: 90, unit: 'MINUTES')
}
}
def createBuildNode(Boolean archive, String docker_image, String target) {
return {
// TODO: fix the snapdragon image
bypass_entrypoint = ''
if (docker_image == 'lorenzmeier/px4-dev-snapdragon:2020-04-01') {
bypass_entrypoint = ' --entrypoint=""'
}
node {
docker.withRegistry('https://registry.hub.docker.com', 'docker_hub_dagar') {
docker.image(docker_image).inside('-e CCACHE_BASEDIR=${WORKSPACE} -v ${CCACHE_DIR}:${CCACHE_DIR}:rw' + bypass_entrypoint) {
stage(target) {
try {
sh('export')
checkout(scm)
sh('make distclean')
sh('git fetch --tags')
sh('ccache -s')
sh('make ' + target)
sh('ccache -s')
sh('make sizes')
if (archive) {
archiveArtifacts(allowEmptyArchive: false, artifacts: 'build/*/*.px4, build/*/*.elf, build/*/*.bin', fingerprint: true, onlyIfSuccessful: true)
}
sh('make ' + target + ' package')
archiveArtifacts(allowEmptyArchive: true, artifacts: 'build/*/*.tar.bz2', fingerprint: true, onlyIfSuccessful: true)
archiveArtifacts(allowEmptyArchive: true, artifacts: 'build/*/*.deb', fingerprint: true, onlyIfSuccessful: true)
}
catch (exc) {
throw (exc)
}
finally {
sh('make distclean')
}
}
}
}
}
}
}
This diff is collapsed. Click to expand it.
---
Checks: '*,
-android*,
-bugprone-integer-division,
-cert-dcl50-cpp,
-cert-env33-c,
-cert-err34-c,
-cert-err58-cpp,
-cert-msc30-c,
-cert-msc50-cpp,
-clang-analyzer-core.CallAndMessage,
-clang-analyzer-core.NullDereference,
-clang-analyzer-core.UndefinedBinaryOperatorResult,
-clang-analyzer-core.uninitialized.Assign,
-clang-analyzer-core.VLASize,
-clang-analyzer-cplusplus.NewDelete,
-clang-analyzer-cplusplus.NewDeleteLeaks,
-clang-analyzer-deadcode.DeadStores,
-clang-analyzer-optin.cplusplus.VirtualCall,
-clang-analyzer-optin.performance.Padding,
-clang-analyzer-security.insecureAPI.strcpy,
-clang-analyzer-unix.API,
-clang-analyzer-unix.cstring.BadSizeArg,
-clang-analyzer-unix.Malloc,
-clang-analyzer-unix.MallocSizeof,
-cppcoreguidelines-c-copy-assignment-signature,
-cppcoreguidelines-interfaces-global-init,
-cppcoreguidelines-no-malloc,
-cppcoreguidelines-owning-memory,
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
-cppcoreguidelines-pro-bounds-constant-array-index,
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
-cppcoreguidelines-pro-type-const-cast,
-cppcoreguidelines-pro-type-cstyle-cast,
-cppcoreguidelines-pro-type-member-init,
-cppcoreguidelines-pro-type-reinterpret-cast,
-cppcoreguidelines-pro-type-union-access,
-cppcoreguidelines-pro-type-vararg,
-cppcoreguidelines-special-member-functions,
-fuchsia-default-arguments,
-fuchsia-overloaded-operator,
-google-build-using-namespace,
-google-explicit-constructor,
-google-global-names-in-headers,
-google-readability-casting,
-google-readability-function-size,
-google-readability-namespace-comments,
-google-readability-todo,
-google-runtime-int,
-google-runtime-references,
-hicpp-deprecated-headers,
-hicpp-explicit-conversions,
-hicpp-function-size,
-hicpp-member-init,
-hicpp-no-array-decay,
-hicpp-no-assembler,
-hicpp-no-malloc,
-hicpp-signed-bitwise,
-hicpp-special-member-functions,
-hicpp-use-auto,
-hicpp-use-equals-default,
-hicpp-use-equals-delete,
-hicpp-use-override,
-hicpp-vararg,
-llvm-header-guard,
-llvm-include-order,
-llvm-namespace-comment,
-misc-incorrect-roundings,
-misc-macro-parentheses,
-misc-misplaced-widening-cast,
-misc-redundant-expression,
-misc-unconventional-assign-operator,
-misc-unused-parameters,
-modernize-deprecated-headers,
-modernize-loop-convert,
-modernize-pass-by-value,
-modernize-return-braced-init-list,
-modernize-use-auto,
-modernize-use-bool-literals,
-modernize-use-default-member-init,
-modernize-use-equals-default,
-modernize-use-equals-delete,
-modernize-use-override,
-modernize-use-using,
-performance-inefficient-string-concatenation,
-readability-avoid-const-params-in-decls,
-readability-container-size-empty,
-readability-else-after-return,
-readability-function-size,
-readability-implicit-bool-cast,
-readability-implicit-bool-conversion,
-readability-inconsistent-declaration-parameter-name,
-readability-named-parameter,
-readability-non-const-parameter,
-readability-redundant-declaration,
-readability-static-accessed-through-instance,
-readability-static-definition-in-anonymous-namespace,
'
WarningsAsErrors: '*'
CheckOptions:
- key: google-readability-function-size.BranchThreshold
value: '600'
- key: google-readability-function-size.LineThreshold
value: '4000'
- key: google-readability-function-size.StatementThreshold
value: '4000'
...
// For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.134.0/containers/cpp
{
"name": "px4-dev-nuttx",
"image": "px4io/px4-dev-nuttx-focal:2021-04-29",
"runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" ],
// Set *default* container specific settings.json values on container create.
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"chiehyu.vscode-astyle",
"dan-c-underwood.arm",
"fredericbonnet.cmake-test-adapter",
"github.vscode-pull-request-github",
"marus25.cortex-debug",
"ms-azuretools.vscode-docker",
"ms-iot.vscode-ros",
"ms-python.python",
"ms-vscode.cmake-tools",
"ms-vscode.cpptools",
"ms-vscode.cpptools-extension-pack",
"redhat.vscode-yaml",
"streetsidesoftware.code-spell-checker",
"twxs.cmake",
"uavcan.dsdl",
"wholroyd.jinja",
"zixuanwang.linkerscript"
],
"containerUser": "user",
"containerEnv": {
"LOCAL_USER_ID": "${localEnv:UID}"
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [14556],
}
* text=auto eol=lf
*.cmake text eol=lf
*.c text eol=lf
*.cc text eol=lf
*.cpp text eol=lf
*.h text eol=lf
*.hh text eol=lf
*.hpp text eol=lf
*.hxx text eol=lf
*.S text eol=lf
*.ipynb text eol=lf
*.m text eol=lf
*.mat binary
*.py text eol=lf
*.java text eol=lf
*.jar binary
*.xml text eol=lf
# PX4 mixers, msgs, etc
*.bin binary
*.mix text eol=lf
*.msg text eol=lf
*.config text eol=lf
*.sdf text eol=lf
*.uavcan text eol=lf
# NuttX
Makefile.* text eol=lf
*.defs text eol=lf
*.ld text eol=lf
*.csv text eol=lf
*.md text eol=lf
*.txt text eol=lf
# Scripts
*.bash text eol=lf
*.sh text eol=lf
*.zsh text eol=lf
# These are explicitly windows files and should use crlf
*.ps1 text eol=crlf
*.{cmd,[cC][mM][dD]} text eol=crlf
*.{bat,[bB][aA][tT]} text eol=crlf
# Serialisation
*.json text eol=lf
*.toml text eol=lf
*.xml text eol=lf
*.yaml text eol=lf
*.yml text eol=lf
# Graphics
*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
*.tif binary
*.tiff binary
*.ico binary
*.pdf binary
# SVG treated as an asset (binary) by default.
*.svg text eol=lf
# Text files where line endings should be preserved
*.patch -text
# Archives
*.7z binary
*.gz binary
*.tar binary
*.tgz binary
*.zip binary
# everything else
.gitattributes text eol=lf
.gitignore text eol=lf
Makefile text eol=lf
---
name: Bug report
about: Create a report to help us improve
---
**Describe the bug**
A clear and concise description of the bug.
**To Reproduce**
Steps to reproduce the behavior:
1. Drone switched on '...'
2. Uploaded mission '....' (attach QGC mission file)
3. Took off '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Log Files and Screenshots**
*Always* provide a link to the flight log file:
- Download the flight log file from the vehicle ([tutorial](https://docs.px4.io/master/en/getting_started/flight_reporting.html)).
- Share the link to a log showing the problem on [PX4 Flight Review](http://logs.px4.io/).
Add screenshots to help explain your problem.
**Drone (please complete the following information):**
- Describe the type of drone.
- Photo of the IMU / autopilot setup if possible.
**Additional context**
Add any other context about the problem here.
---
name: 🚀 Feature Request
about: Suggest an idea for this project
---
For general questions please use [PX4 Discuss](http://discuss.px4.io/) or [Slack](http://slack.px4.io/).
**Describe problem solved by the proposed feature**
A clear and concise description of the problem, if any, this feature will solve. E.g. I'm always frustrated when ...
**Describe your preferred solution**
A clear and concise description of what you want to happen.
**Describe possible alternatives**
A clear and concise description of alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots for the feature request here.
---
name: ⛔ Support Question
about: See [PX4 Discuss](http://discuss.px4.io/) for questions about using PX4.
---
We use GitHub issues only to discuss PX4 bugs and new features. For
questions about using PX4 or related components, please use [PX4 Discuss](http://discuss.px4.io/).
Thanks!
---
name: ⛔ Documentation Issue
about: See https://github.com/PX4/Devguide for documentation issues
---
PX4 has dedicated repositories for developer documentation (https://github.com/PX4/Devguide) and user documentation (https://github.com/PX4/px4_user_guide).
Thanks!
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 90
# Number of days of inactivity before a stale issue is closed, or `false` to disable
daysUntilClose: false
# Issues with these labels will never be considered stale
exemptLabels:
- pinned
# Label to use when marking an issue as stale
staleLabel: stale
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. Thank you for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false
name: Checks
on:
push:
branches:
- 'master'
pull_request:
branches:
- '*'
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
check: [
"check_format",
"tests",
"tests_coverage",
"px4_fmu-v2_default stack_check",
"validate_module_configs",
"shellcheck_all",
"NO_NINJA_BUILD=1 px4_fmu-v5_default",
"NO_NINJA_BUILD=1 px4_sitl_default",
"airframe_metadata",
"module_documentation",
"parameters_metadata",
]
container:
image: px4io/px4-dev-nuttx-focal:2021-04-29
options: --privileged --ulimit core=-1 --security-opt seccomp=unconfined
steps:
- uses: actions/checkout@v1
with:
token: ${{ secrets.ACCESS_TOKEN }}
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
message("::set-output name=timestamp::${current_date}")
- name: ccache cache files
uses: actions/cache@v2
with:
path: ~/.ccache
key: tests_${{matrix.ubuntu_release}}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}}
restore-keys: tests_${{matrix.ubuntu_release}}-ccache-
- name: setup ccache
run: |
mkdir -p ~/.ccache
echo "base_dir = ${GITHUB_WORKSPACE}" > ~/.ccache/ccache.conf
echo "compression = true" >> ~/.ccache/ccache.conf
echo "compression_level = 5" >> ~/.ccache/ccache.conf
echo "max_size = 100M" >> ~/.ccache/ccache.conf
ccache -s
ccache -z
- name: check environment
run: |
export
ulimit -a
- name: ${{matrix.check}}
run: make ${{matrix.check}}
- name: upload coverage
if: contains(matrix.check, 'coverage')
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unittests
file: coverage/lcov.info
name: Clang Tidy
on:
push:
branches:
- 'master'
pull_request:
branches:
- '*'
jobs:
build:
runs-on: ubuntu-latest
container: px4io/px4-dev-clang:2021-04-29
steps:
- uses: actions/checkout@v1
with:
token: ${{secrets.ACCESS_TOKEN}}
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
message("::set-output name=timestamp::${current_date}")
- name: ccache cache files
uses: actions/cache@v2
with:
path: ~/.ccache
key: clang-tidy-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}}
restore-keys: clang-tidy-ccache-
- name: setup ccache
run: |
mkdir -p ~/.ccache
echo "base_dir = ${GITHUB_WORKSPACE}" > ~/.ccache/ccache.conf
echo "compression = true" >> ~/.ccache/ccache.conf
echo "compression_level = 5" >> ~/.ccache/ccache.conf
echo "max_size = 100M" >> ~/.ccache/ccache.conf
ccache -s
ccache -z
- name: make clang-tidy-quiet
run: |
ccache -z
make clang-tidy-quiet
ccache -s
name: Linux Targets
on:
push:
branches:
- 'master'
pull_request:
branches:
- '*'
jobs:
build:
runs-on: ubuntu-latest
container: px4io/px4-dev-armhf:2021-04-29
strategy:
matrix:
config: [
beaglebone_blue_default,
emlid_navio2_default,
px4_raspberrypi_default,
scumaker_pilotpi_default,
]
steps:
- uses: actions/checkout@v1
with:
token: ${{secrets.ACCESS_TOKEN}}
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
message("::set-output name=timestamp::${current_date}")
- name: ccache cache files
uses: actions/cache@v2
with:
path: ~/.ccache
key: ${{matrix.config}}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}}
restore-keys: ${{matrix.config}}-ccache-
- name: setup ccache
run: |
mkdir -p ~/.ccache
echo "base_dir = ${GITHUB_WORKSPACE}" > ~/.ccache/ccache.conf
echo "compression = true" >> ~/.ccache/ccache.conf
echo "compression_level = 5" >> ~/.ccache/ccache.conf
echo "max_size = 100M" >> ~/.ccache/ccache.conf
ccache -s
ccache -z
- name: make ${{matrix.config}}
run: make ${{matrix.config}}
- name: ccache post-run
run: ccache -s
name: Linux ARM64 Targets
on:
push:
branches:
- 'master'
pull_request:
branches:
- '*'
jobs:
build:
runs-on: ubuntu-latest
container: px4io/px4-dev-aarch64:2021-04-29
strategy:
matrix:
config: [
scumaker_pilotpi_arm64,
]
steps:
- uses: actions/checkout@v1
with:
token: ${{secrets.ACCESS_TOKEN}}
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
message("::set-output name=timestamp::${current_date}")
- name: ccache cache files
uses: actions/cache@v2
with:
path: ~/.ccache
key: ${{matrix.config}}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}}
restore-keys: ${{matrix.config}}-ccache-
- name: setup ccache
run: |
mkdir -p ~/.ccache
echo "base_dir = ${GITHUB_WORKSPACE}" > ~/.ccache/ccache.conf
echo "compression = true" >> ~/.ccache/ccache.conf
echo "compression_level = 5" >> ~/.ccache/ccache.conf
echo "max_size = 100M" >> ~/.ccache/ccache.conf
ccache -s
ccache -z
- name: make ${{matrix.config}}
run: make ${{matrix.config}}
- name: ccache post-run
run: ccache -s
name: MacOS build
on:
push:
branches:
- 'master'
pull_request:
branches:
- '*'
jobs:
build:
runs-on: macos-10.15
strategy:
matrix:
config: [
px4_fmu-v5_default,
px4_sitl
#tests, # includes px4_sitl
]
steps:
- uses: actions/checkout@v1
with:
token: ${{secrets.ACCESS_TOKEN}}
- name: setup
run: ./Tools/setup/macos.sh; ./Tools/setup/macos.sh
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
message("::set-output name=timestamp::${current_date}")
- name: ccache cache files
uses: actions/cache@v2
with:
path: ~/.ccache
key: macos_${{matrix.config}}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}}
restore-keys: macos_${{matrix.config}}-ccache-
- name: setup ccache
run: |
mkdir -p ~/.ccache
echo "base_dir = ${GITHUB_WORKSPACE}" > ~/.ccache/ccache.conf
echo "compression = true" >> ~/.ccache/ccache.conf
echo "compression_level = 5" >> ~/.ccache/ccache.conf
echo "max_size = 100M" >> ~/.ccache/ccache.conf
ccache -s
ccache -z
- name: make ${{matrix.config}}
run: |
ccache -z
make ${{matrix.config}}
ccache -s
name: Nuttx Targets
on:
push:
branches:
- 'master'
pull_request:
branches:
- '*'
jobs:
build:
runs-on: ubuntu-latest
container: px4io/px4-dev-nuttx-focal:2021-04-29
strategy:
matrix:
config: [
airmind_mindpx-v2_default,
ark_can-flow_canbootloader,
ark_can-flow_debug,
ark_can-flow_default,
ark_can-gps_canbootloader,
ark_can-gps_debug,
ark_can-gps_default,
av_x-v1_default,
bitcraze_crazyflie21_default,
bitcraze_crazyflie_default,
cuav_can-gps-v1_canbootloader,
cuav_can-gps-v1_debug,
cuav_can-gps-v1_default,
cuav_nora_default,
cuav_x7pro_default,
cubepilot_cubeorange_default,
cubepilot_cubeorange_test,
cubepilot_cubeyellow_default,
cubepilot_cubeyellow_test,
cubepilot_io-v2_default,
freefly_can-rtk-gps_canbootloader,
freefly_can-rtk-gps_default,
holybro_can-gps-v1_canbootloader,
holybro_can-gps-v1_debug,
holybro_can-gps-v1_default,
holybro_durandal-v1_default,
holybro_kakutef7_default,
holybro_pix32v5_default,
modalai_fc-v1_default,
modalai_fc-v1_rtps,
modalai_fc-v2_default,
mro_ctrl-zero-f7-oem_default,
mro_ctrl-zero-f7_default,
mro_ctrl-zero-h7-oem_default,
mro_ctrl-zero-h7_default,
mro_pixracerpro_default,
mro_x21-777_default,
mro_x21_default,
nxp_fmuk66-e_default,
nxp_fmuk66-e_rtps,
nxp_fmuk66-e_socketcan,
nxp_fmuk66-v3_default,
nxp_fmuk66-v3_rtps,
nxp_fmuk66-v3_socketcan,
nxp_fmurt1062-v1_default,
nxp_ucans32k146_canbootloader,
nxp_ucans32k146_default,
omnibus_f4sd_default,
px4_fmu-v2_default,
px4_fmu-v2_fixedwing,
px4_fmu-v2_multicopter,
px4_fmu-v2_rover,
px4_fmu-v3_default,
px4_fmu-v4_cannode,
px4_fmu-v4_default,
px4_fmu-v4pro_default,
px4_fmu-v5_ctrlalloc,
px4_fmu-v5_debug,
px4_fmu-v5_default,
px4_fmu-v5_fixedwing,
px4_fmu-v5_multicopter,
px4_fmu-v5_optimized,
px4_fmu-v5_rover,
px4_fmu-v5_rtps,
px4_fmu-v5_stackcheck,
px4_fmu-v5_uavcanv0periph,
px4_fmu-v5_uavcanv1,
px4_fmu-v5x_base_phy_DP83848C,
px4_fmu-v5x_default,
px4_fmu-v6u_default,
px4_fmu-v6x_default,
px4_io-v2_default,
spracing_h7extreme_default,
uvify_core_default
]
steps:
- uses: actions/checkout@v1
with:
token: ${{secrets.ACCESS_TOKEN}}
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
message("::set-output name=timestamp::${current_date}")
- name: ccache cache files
uses: actions/cache@v2
with:
path: ~/.ccache
key: ${{matrix.config}}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}}
restore-keys: ${{matrix.config}}-ccache-
- name: setup ccache
run: |
mkdir -p ~/.ccache
echo "base_dir = ${GITHUB_WORKSPACE}" > ~/.ccache/ccache.conf
echo "compression = true" >> ~/.ccache/ccache.conf
echo "compression_level = 5" >> ~/.ccache/ccache.conf
echo "max_size = 100M" >> ~/.ccache/ccache.conf
ccache -s
ccache -z
- name: make ${{matrix.config}}
run: make ${{matrix.config}}
- name: make ${{matrix.config}} bloaty_compileunits
run: make ${{matrix.config}} bloaty_compileunits || true
- name: make ${{matrix.config}} bloaty_inlines
run: make ${{matrix.config}} bloaty_inlines || true
- name: make ${{matrix.config}} bloaty_segments
run: make ${{matrix.config}} bloaty_segments || true
- name: make ${{matrix.config}} bloaty_symbols
run: make ${{matrix.config}} bloaty_symbols || true
- name: make ${{matrix.config}} bloaty_templates
run: make ${{matrix.config}} bloaty_templates || true
- name: make ${{matrix.config}} bloaty_ram
run: make ${{matrix.config}} bloaty_ram || true
- name: make ${{matrix.config}} bloaty_compare_master
run: make ${{matrix.config}} bloaty_compare_master || true
- name: ccache post-run
run: ccache -s
- name: Upload px4 package
uses: actions/upload-artifact@v1
with:
name: px4_package_${{matrix.config}}
path: build/${{matrix.config}}/${{matrix.config}}.px4
name: NuttX UAVCAN firmware
on:
push:
branches:
- 'master'
pull_request:
branches:
- '*'
jobs:
build:
runs-on: ubuntu-latest
container: px4io/px4-dev-nuttx-focal:2021-04-29
strategy:
matrix:
config: [
ark_can-flow_default,
cuav_can-gps-v1_default,
freefly_can-rtk-gps_default,
holybro_can-gps-v1_default,
#nxp_ucans32k146_default,
px4_fmu-v4_cannode
]
steps:
- uses: actions/checkout@v1
with:
token: ${{secrets.ACCESS_TOKEN}}
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
message("::set-output name=timestamp::${current_date}")
- name: ccache cache files
uses: actions/cache@v2
with:
path: ~/.ccache
key: ${{matrix.config}}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}}
restore-keys: ${{matrix.config}}-ccache-
- name: setup ccache
run: |
mkdir -p ~/.ccache
echo "base_dir = ${GITHUB_WORKSPACE}" > ~/.ccache/ccache.conf
echo "compression = true" >> ~/.ccache/ccache.conf
echo "compression_level = 5" >> ~/.ccache/ccache.conf
echo "max_size = 100M" >> ~/.ccache/ccache.conf
ccache -s
ccache -z
- name: make ${{matrix.config}}
run: make ${{matrix.config}}
- name: ccache post-run
run: ccache -s
- name: Upload px4 package
uses: actions/upload-artifact@v2
with:
name: px4_cannode_${{matrix.config}}
path: build/${{matrix.config}}/*.uavcan.bin
name: Deploy metadata for all targets
on:
push:
branches:
- 'master'
- 'release/*'
- 'pr-metadata-test'
jobs:
enumerate_targets:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v1
with:
token: ${{secrets.ACCESS_TOKEN}}
- id: set-matrix
run: echo "::set-output name=matrix::$(./Tools/generate_board_targets_json.py)"
build:
runs-on: ubuntu-latest
needs: enumerate_targets
strategy:
matrix: ${{fromJson(needs.enumerate_targets.outputs.matrix)}}
container: px4io/px4-dev-${{ matrix.container }}:2021-04-29
steps:
- uses: actions/checkout@v1
with:
token: ${{secrets.ACCESS_TOKEN}}
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
message("::set-output name=timestamp::${current_date}")
- name: ccache cache files
uses: actions/cache@v2
with:
path: ~/.ccache
key: ${{matrix.target}}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}}
restore-keys: ${{matrix.target}}-ccache-
- name: setup ccache
run: |
mkdir -p ~/.ccache
echo "base_dir = ${GITHUB_WORKSPACE}" > ~/.ccache/ccache.conf
echo "compression = true" >> ~/.ccache/ccache.conf
echo "compression_level = 5" >> ~/.ccache/ccache.conf
echo "max_size = 100M" >> ~/.ccache/ccache.conf
ccache -s
ccache -z
- name: make ${{matrix.target}}
run: make ${{matrix.target}}
- name: ccache post-run
run: ccache -s
- name: parameter metadata
run: |
make ${{matrix.target}} ver_gen
./src/lib/version/get_git_tag_or_branch_version.sh build/${{ matrix.target }} >> $GITHUB_ENV
cd build/${{ matrix.target }}
mkdir _metadata || true
cp parameters.* _metadata
- uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read
env:
AWS_S3_BUCKET: 'px4-travis'
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'us-west-1'
SOURCE_DIR: 'build/${{ matrix.target }}/_metadata/'
DEST_DIR: 'Firmware/${{ env.version }}/${{ matrix.target }}/'
name: MAVROS Mission Tests
on:
push:
branches:
- 'master'
pull_request:
branches:
- '*'
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
config:
- {vehicle: "iris", mission: "MC_mission_box", build_type: "RelWithDebInfo"}
- {vehicle: "rover", mission: "rover_mission_1", build_type: "RelWithDebInfo"}
#- {vehicle: "plane", mission: "FW_mission_1", build_type: "RelWithDebInfo"}
#- {vehicle: "plane_catapult",mission: "FW_mission_1", build_type: "RelWithDebInfo"}
#- {vehicle: "standard_vtol", mission: "VTOL_mission_1", build_type: "Coverage"}
#- {vehicle: "standard_vtol", mission: "VTOL_mission_1", build_type: "AddressSanitizer"}
#- {vehicle: "tailsitter", mission: "VTOL_mission_1", build_type: "RelWithDebInfo"}
#- {vehicle: "tiltrotor", mission: "VTOL_mission_1", build_type: "RelWithDebInfo"}
container:
image: px4io/px4-dev-ros-melodic:2021-04-29
options: --privileged --ulimit core=-1 --security-opt seccomp=unconfined
steps:
- uses: actions/checkout@v1
with:
token: ${{ secrets.ACCESS_TOKEN }}
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
message("::set-output name=timestamp::${current_date}")
- name: ccache cache files
uses: actions/cache@v2
with:
path: ~/.ccache
key: sitl_tests-${{matrix.config.build_type}}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}}
restore-keys: sitl_tests-${{matrix.config.build_type}}-ccache-
- name: setup ccache
run: |
mkdir -p ~/.ccache
echo "base_dir = ${GITHUB_WORKSPACE}" > ~/.ccache/ccache.conf
echo "compression = true" >> ~/.ccache/ccache.conf
echo "compression_level = 5" >> ~/.ccache/ccache.conf
echo "max_size = 100M" >> ~/.ccache/ccache.conf
ccache -s
ccache -z
- name: check environment
run: |
export
ulimit -a
- name: Build PX4 and sitl_gazebo
env:
PX4_CMAKE_BUILD_TYPE: ${{matrix.config.build_type}}
run: |
ccache -z
make px4_sitl_default
make px4_sitl_default sitl_gazebo
ccache -s
- name: Core dump settings
run: |
ulimit -c unlimited
echo "`pwd`/%e.core" > /proc/sys/kernel/core_pattern
- name: Run SITL tests
env:
PX4_CMAKE_BUILD_TYPE: ${{matrix.config.build_type}}
run: |
export
./test/rostest_px4_run.sh mavros_posix_test_mission.test mission:=${{matrix.config.mission}} vehicle:=${{matrix.config.vehicle}}
- name: Look at core files
if: failure()
run: gdb build/px4_sitl_default/bin/px4 px4.core -ex "thread apply all bt" -ex "quit"
- name: Upload px4 coredump
if: failure()
uses: actions/upload-artifact@v2-preview
with:
name: coredump
path: px4.core
- name: ecl EKF analysis
if: always()
run: ./Tools/ecl_ekf/process_logdata_ekf.py ~/.ros/log/*/*.ulg || true
- name: Upload logs to flight review
if: always()
run: ./Tools/upload_log.py -q --description "${GITHUB_WORKFLOW} ${GITHUB_RUN_ID}" --feedback "${GITHUB_WORKFLOW} ${GITHUB_RUN_ID} ${GITHUB_REPOSITORY} ${GITHUB_REF}" --source CI ~/.ros/log/*/*.ulg
- name: Upload px4 binary
if: failure()
uses: actions/upload-artifact@v2
with:
name: binary
path: build/px4_sitl_default/bin/px4
- name: Store PX4 log
if: failure()
uses: actions/upload-artifact@v2
with:
name: px4_log
path: ~/.ros/log/*/*.ulg
- name: Store ROS log
if: failure()
uses: actions/upload-artifact@v2
with:
name: ros_log
path: ~/.ros/**/rostest-*.log
# Report test coverage
- name: Upload coverage
if: contains(matrix.config.build_type, 'Coverage')
run: |
git config --global credential.helper "" # disable the keychain credential helper
git config --global --add credential.helper store # enable the local store credential helper
echo "https://x-access-token:${{ secrets.ACCESS_TOKEN }}@github.com" >> ~/.git-credentials # add credential
git config --global url."https://github.com/".insteadof git@github.com: # credentials add credential
mkdir -p coverage
lcov --directory build/px4_sitl_default --base-directory build/px4_sitl_default --gcov-tool gcov --capture -o coverage/lcov.info
- name: Upload coverage information to Codecov
if: contains(matrix.config.build_type, 'Coverage')
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: mavros_mission
file: coverage/lcov.info
name: MAVROS Offboard Tests
on:
push:
branches:
- 'master'
pull_request:
branches:
- '*'
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
config:
- {test_file: "mavros_posix_tests_offboard_posctl.test", vehicle: "iris", build_type: "RelWithDebInfo"}
#- {test_file: "mavros_posix_tests_offboard_attctl.test", vehicle: "iris", build_type: "RelWithDebInfo"}
#- {test_file: "mavros_posix_tests_offboard_rpyrt_ctl.test", vehicle: "iris", build_type: "RelWithDebInfo"}
container:
image: px4io/px4-dev-ros-melodic:2021-04-29
options: --privileged --ulimit core=-1 --security-opt seccomp=unconfined
steps:
- uses: actions/checkout@v1
with:
token: ${{ secrets.ACCESS_TOKEN }}
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
message("::set-output name=timestamp::${current_date}")
- name: ccache cache files
uses: actions/cache@v2
with:
path: ~/.ccache
key: sitl_tests-${{matrix.config.build_type}}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}}
restore-keys: sitl_tests-${{matrix.config.build_type}}-ccache-
- name: setup ccache
run: |
mkdir -p ~/.ccache
echo "base_dir = ${GITHUB_WORKSPACE}" > ~/.ccache/ccache.conf
echo "compression = true" >> ~/.ccache/ccache.conf
echo "compression_level = 5" >> ~/.ccache/ccache.conf
echo "max_size = 100M" >> ~/.ccache/ccache.conf
ccache -s
ccache -z
- name: check environment
run: |
export
ulimit -a
- name: Build PX4 and sitl_gazebo
env:
PX4_CMAKE_BUILD_TYPE: ${{matrix.config.build_type}}
run: |
ccache -z
make px4_sitl_default
make px4_sitl_default sitl_gazebo
ccache -s
- name: Core dump settings
run: |
ulimit -c unlimited
echo "`pwd`/%e.core" > /proc/sys/kernel/core_pattern
- name: Run SITL tests
env:
PX4_CMAKE_BUILD_TYPE: ${{matrix.config.build_type}}
run: |
export
./test/rostest_px4_run.sh ${{matrix.config.test_file}} vehicle:=${{matrix.config.vehicle}}
- name: Look at core files
if: failure()
run: gdb build/px4_sitl_default/bin/px4 px4.core -ex "thread apply all bt" -ex "quit"
- name: Upload px4 coredump
if: failure()
uses: actions/upload-artifact@v2-preview
with:
name: coredump
path: px4.core
- name: ecl EKF analysis
if: always()
run: ./Tools/ecl_ekf/process_logdata_ekf.py ~/.ros/log/*/*.ulg || true
- name: Upload logs to flight review
if: always()
run: ./Tools/upload_log.py -q --description "${GITHUB_WORKFLOW} ${GITHUB_RUN_ID}" --feedback "${GITHUB_WORKFLOW} ${GITHUB_RUN_ID} ${GITHUB_REPOSITORY} ${GITHUB_REF}" --source CI ~/.ros/log/*/*.ulg
- name: Upload px4 binary
if: failure()
uses: actions/upload-artifact@v2
with:
name: binary
path: build/px4_sitl_default/bin/px4
- name: Store PX4 log
if: failure()
uses: actions/upload-artifact@v2
with:
name: px4_log
path: ~/.ros/log/*/*.ulg
- name: Store ROS log
if: failure()
uses: actions/upload-artifact@v2
with:
name: ros_log
path: ~/.ros/**/rostest-*.log
# Report test coverage
- name: Upload coverage
if: contains(matrix.config.build_type, 'Coverage')
run: |
git config --global credential.helper "" # disable the keychain credential helper
git config --global --add credential.helper store # enable the local store credential helper
echo "https://x-access-token:${{ secrets.ACCESS_TOKEN }}@github.com" >> ~/.git-credentials # add credential
git config --global url."https://github.com/".insteadof git@github.com: # credentials add credential
mkdir -p coverage
lcov --directory build/px4_sitl_default --base-directory build/px4_sitl_default --gcov-tool gcov --capture -o coverage/lcov.info
- name: Upload coverage information to Codecov
if: contains(matrix.config.build_type, 'Coverage')
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: mavros_offboard
file: coverage/lcov.info
name: Metadata
on:
push:
branches:
- 'master'
- 'release/*'
- 'pr-metadata-test'
jobs:
airframe:
runs-on: ubuntu-latest
container: px4io/px4-dev-base-focal:2021-04-29
steps:
- uses: actions/checkout@v1
with:
token: ${{ secrets.ACCESS_TOKEN }}
- name: airframe metadata
run: |
make airframe_metadata
cd build/px4_sitl_default/docs
ls -ls *
# TODO: deploy to userguide gitbook and s3
module:
runs-on: ubuntu-latest
container: px4io/px4-dev-base-focal:2021-04-29
steps:
- uses: actions/checkout@v1
with:
token: ${{ secrets.ACCESS_TOKEN }}
- name: module documentation
run: |
make module_documentation
cd build/px4_sitl_default/docs
ls -ls *
# TODO: deploy to userguide gitbook and s3
parameter:
runs-on: ubuntu-latest
container: px4io/px4-dev-base-focal:2021-04-29
steps:
- uses: actions/checkout@v1
with:
token: ${{ secrets.ACCESS_TOKEN }}
- name: parameter metadata
run: |
make parameters_metadata
./src/lib/version/get_git_tag_or_branch_version.sh build/px4_sitl_default >> $GITHUB_ENV
- uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read
env:
AWS_S3_BUCKET: 'px4-travis'
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'us-west-1'
SOURCE_DIR: 'build/px4_sitl_default/docs/'
DEST_DIR: 'Firmware/${{ env.version }}/_general/'
uorb_graph:
runs-on: ubuntu-latest
container: px4io/px4-dev-nuttx-focal:2021-04-29
steps:
- uses: actions/checkout@v1
with:
token: ${{ secrets.ACCESS_TOKEN }}
- name: uORB graph
run: |
make uorb_graphs
cd Tools/uorb_graph
ls -ls *
# TODO: deploy graph_px4_sitl.json to S3 px4-travis:Firmware/master/
micrortps_agent:
runs-on: ubuntu-latest
container: px4io/px4-dev-base-focal:2021-04-29
steps:
- uses: actions/checkout@v1
with:
token: ${{ secrets.ACCESS_TOKEN }}
- name: microRTPS agent
run: |
make px4_sitl_rtps
git clone https://github.com/PX4/micrortps_agent.git
cp -R build/px4_sitl_rtps/src/modules/micrortps_bridge/micrortps_agent/* micrortps_agent
ROS_msgs:
runs-on: ubuntu-latest
container: px4io/px4-dev-base-focal:2021-04-29
steps:
- uses: actions/checkout@v1
with:
token: ${{ secrets.ACCESS_TOKEN }}
- name: PX4 ROS msgs
run: |
git clone https://github.com/PX4/px4_msgs.git
python3 msg/tools/uorb_to_ros_msgs.py msg/ px4_msgs/msg/
ROS2_bridge:
runs-on: ubuntu-latest
container: px4io/px4-dev-base-focal:2021-04-29
steps:
- uses: actions/checkout@v1
with:
token: ${{ secrets.ACCESS_TOKEN }}
- name: PX4 ROS2 bridge
run: |
git clone https://github.com/PX4/px4_ros_com.git
./msg/tools/uorb_to_ros_rtps_ids.py -i msg/tools/uorb_rtps_message_ids.yaml -o px4_ros_com/templates/uorb_rtps_message_ids.yaml
name: Python CI Checks
on:
push:
branches:
- 'master'
pull_request:
branches:
- '*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
with:
token: ${{ secrets.ACCESS_TOKEN }}
- name: Install Python3
run: sudo apt-get install python3 python3-setuptools python3-pip -y
- name: Install tools
run: pip3 install --user mypy flake8
- name: Check MAVSDK test scripts with mypy
run: $HOME/.local/bin/mypy --strict test/mavsdk_tests/*.py
- name: Check MAVSDK test scripts with flake8
run: $HOME/.local/bin/flake8 test/mavsdk_tests/*.py
name: SITL Tests
on:
push:
branches:
- 'master'
pull_request:
branches:
- '*'
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
config:
- {latitude: "59.617693", longitude: "-151.145316", altitude: "48", build_type: "RelWithDebInfo", model: "iris" } # Alaska
- {latitude: "-38.071235", longitude: "145.281220", altitude: "31", build_type: "RelWithDebInfo", model: "standard_vtol" } # Australia
- {latitude: "29.660316", longitude: "-82.316658", altitude: "30", build_type: "RelWithDebInfo", model: "tailsitter" } # Florida
- {latitude: "47.397742", longitude: "8.545594", altitude: "488", build_type: "Coverage", model: "standard_vtol" } # Zurich
container:
image: px4io/px4-dev-simulation-focal:2021-04-29
options: --privileged --ulimit core=-1 --security-opt seccomp=unconfined
steps:
- uses: actions/checkout@v1
with:
token: ${{ secrets.ACCESS_TOKEN }}
- name: Download MAVSDK
run: wget "https://github.com/mavlink/MAVSDK/releases/download/v$(cat test/mavsdk_tests/MAVSDK_VERSION)/mavsdk_$(cat test/mavsdk_tests/MAVSDK_VERSION)_ubuntu20.04_amd64.deb"
- name: Install MAVSDK
run: dpkg -i "mavsdk_$(cat test/mavsdk_tests/MAVSDK_VERSION)_ubuntu20.04_amd64.deb"
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
message("::set-output name=timestamp::${current_date}")
- name: ccache cache files
uses: actions/cache@v2
with:
path: ~/.ccache
key: sitl_tests-${{matrix.config.build_type}}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}}
restore-keys: sitl_tests-${{matrix.config.build_type}}-ccache-
- name: setup ccache
run: |
mkdir -p ~/.ccache
echo "base_dir = ${GITHUB_WORKSPACE}" > ~/.ccache/ccache.conf
echo "compression = true" >> ~/.ccache/ccache.conf
echo "compression_level = 5" >> ~/.ccache/ccache.conf
echo "max_size = 100M" >> ~/.ccache/ccache.conf
ccache -s
ccache -z
- name: check environment
env:
PX4_HOME_LAT: ${{matrix.config.latitude}}
PX4_HOME_LON: ${{matrix.config.longitude}}
PX4_HOME_ALT: ${{matrix.config.altitude}}
PX4_CMAKE_BUILD_TYPE: ${{matrix.config.build_type}}
run: |
export
ulimit -a
- name: Build PX4
env:
PX4_CMAKE_BUILD_TYPE: ${{matrix.config.build_type}}
run: make px4_sitl_default
- name: ccache post-run px4/firmware
run: ccache -s
- name: Build SITL Gazebo
env:
PX4_CMAKE_BUILD_TYPE: ${{matrix.config.build_type}}
run: make px4_sitl_default sitl_gazebo
- name: ccache post-run sitl_gazebo
run: ccache -s
- name: Build MAVSDK tests
env:
PX4_CMAKE_BUILD_TYPE: ${{matrix.config.build_type}}
DONT_RUN: 1
run: make px4_sitl_default gazebo mavsdk_tests
- name: ccache post-run mavsdk_tests
run: ccache -s
- name: Core dump settings
run: |
ulimit -c unlimited
echo "`pwd`/%e.core" > /proc/sys/kernel/core_pattern
- name: Run SITL tests
env:
PX4_HOME_LAT: ${{matrix.config.latitude}}
PX4_HOME_LON: ${{matrix.config.longitude}}
PX4_HOME_ALT: ${{matrix.config.altitude}}
PX4_CMAKE_BUILD_TYPE: ${{matrix.config.build_type}}
run: test/mavsdk_tests/mavsdk_test_runner.py --speed-factor 20 --abort-early --model ${{matrix.config.model}} --upload test/mavsdk_tests/configs/sitl.json
- name: Look at core files
if: failure()
run: gdb build/px4_sitl_default/bin/px4 px4.core -ex "thread apply all bt" -ex "quit"
- name: Upload px4 coredump
if: failure()
uses: actions/upload-artifact@v2-preview
with:
name: coredump
path: px4.core
- name: Upload px4 binary
if: failure()
uses: actions/upload-artifact@v2-preview
with:
name: binary
path: build/px4_sitl_default/bin/px4
# Report test coverage
- name: Upload coverage
if: contains(matrix.config.build_type, 'Coverage')
run: |
git config --global credential.helper "" # disable the keychain credential helper
git config --global --add credential.helper store # enable the local store credential helper
echo "https://x-access-token:${{ secrets.ACCESS_TOKEN }}@github.com" >> ~/.git-credentials # add credential
git config --global url."https://github.com/".insteadof git@github.com: # credentials add credential
mkdir -p coverage
lcov --directory build/px4_sitl_default --base-directory build/px4_sitl_default --gcov-tool gcov --capture -o coverage/lcov.info
- name: Upload coverage information to Codecov
if: contains(matrix.config.build_type, 'Coverage')
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: mavsdk
file: coverage/lcov.info
# How to install:
# gem install github_changelog_generator
# How to run:
# github_changelog_generator -u PX4 -p Firmware
# Description:
# The following params are sensible defaults for the PX4 project,
# if you want to do a changelog before a release you need to update since-tag and future-releases,
# Params:
# github_changelog_generator --help for all options
# max-issues
# max threshold for github api queries
# make sure you set your CHANGELOG_GITHUB_TOKEN before
# running
max-issues=1500
# exclude-tags-regex
# excludes release candidates
exclude-tags-regex=rc[0-9]{1,}|beta[0-9]{1,}
# since-tag
# version of last stable release
# you need to change this depending on what you need
# if you want a changelog between versions this is the lowest version
since-tag=1.6.5
# future-release
# version you are about to release
# if you want a changelog between a version and all unreleased changes grouped as a release
# eg: v1.6.5 to v1.7.0
future-release=v1.7.0
*.dSYM
*.o
*.gch
*.pyc
*~
.*.swp
.context
.cproject
.DS_Store
.gdbinit
.gdb_history
.project
.settings
.swp
.~lock.*
Testing/
Packages/*
build/*
build_*/
cscope.out
cscope.in.out
cscope.po.out
Firmware.sublime-workspace
user.sublime*
/Documentation/doxy.log
/Documentation/html/
/Documentation/doxygen*objdb*tmp
.tags
tags
.tags_sorted_by_file
.pydevproject
.ropeproject
*.orig
Firmware.zip
*.generated.h
.vagrant
*.pretty
xcode
rootfs/
*.autosave
CMakeLists.txt.user
GPATH
GRTAGS
GTAGS
*.creator
*.creator.user
*.files
*.includes
# CLion ignores
.idea
cmake-build-*/
posix-configs/SITL/init/test/*_generated
/airframes.md
/airframes.xml
/parameters.md
/parameters.xml
/modules
/msg/ros/*.msg
*.gcov
.coverage
.coverage.*
# KDevelop ignores
.kdev4/*
*.kdev4
# cmake in tree (ninja)
.ninja_deps
.ninja_log
bin/
build.ninja
cmake_install.cmake
CMakeCache.txt
CMakeFiles
compile_commands.json
CPackConfig.cmake
CPackSourceConfig.cmake
CTestTestfile.cmake
external/
rules.ninja
# in tree build
**/*.a
**/*.px4mod
**/*.stamp
/coverage*
/functional-*
/generated_params/
/googletest-*/
/logs
/mavsdk_tests
/test_mixer_multirotor
/unit-*
/uORB/
DartConfiguration.tcl
msg/tmp/
msg/topics_sources/
platforms/posix/apps.cpp
platforms/posix/apps.h
src/lib/version/build_git_version.h
src/modules/simulator/simulator_config.h
src/systemcmds/topic_listener/listener_generated.cpp
# SITL
dataman
eeprom/
[submodule "mavlink/include/mavlink/v2.0"]
path = mavlink/include/mavlink/v2.0
url = https://github.com/mavlink/c_library_v2.git
branch = master
[submodule "src/drivers/uavcan/libuavcan"]
path = src/drivers/uavcan/libuavcan
url = https://github.com/PX4/libuavcan.git
branch = px4
[submodule "Tools/jMAVSim"]
path = Tools/jMAVSim
url = https://github.com/PX4/jMAVSim.git
branch = master
[submodule "Tools/sitl_gazebo"]
path = Tools/sitl_gazebo
url = https://github.com/PX4/PX4-SITL_gazebo.git
branch = master
[submodule "src/lib/matrix"]
path = src/lib/matrix
url = https://github.com/PX4/PX4-Matrix.git
branch = master
[submodule "src/lib/ecl"]
path = src/lib/ecl
url = https://github.com/PX4/PX4-ECL.git
branch = master
[submodule "boards/atlflight/cmake_hexagon"]
path = boards/atlflight/cmake_hexagon
url = https://github.com/PX4/cmake_hexagon.git
branch = px4
[submodule "src/drivers/gps/devices"]
path = src/drivers/gps/devices
url = https://github.com/PX4/PX4-GPSDrivers.git
branch = master
[submodule "src/modules/micrortps_bridge/micro-CDR"]
path = src/modules/micrortps_bridge/micro-CDR
url = https://github.com/PX4/Micro-CDR.git
branch = master
[submodule "platforms/nuttx/NuttX/nuttx"]
path = platforms/nuttx/NuttX/nuttx
url = https://github.com/PX4/NuttX.git
branch = px4_firmware_nuttx-10.0.0+
[submodule "platforms/nuttx/NuttX/apps"]
path = platforms/nuttx/NuttX/apps
url = https://github.com/PX4/NuttX-apps.git
branch = px4_firmware_nuttx-10.0.0+
[submodule "platforms/qurt/dspal"]
path = platforms/qurt/dspal
url = https://github.com/ATLFlight/dspal.git
[submodule "Tools/flightgear_bridge"]
path = Tools/flightgear_bridge
url = https://github.com/PX4/PX4-FlightGear-Bridge.git
[submodule "Tools/jsbsim_bridge"]
path = Tools/jsbsim_bridge
url = https://github.com/PX4/px4-jsbsim-bridge.git
[submodule "src/drivers/uavcan_v1/libcanard"]
path = src/drivers/uavcan_v1/libcanard
url = https://github.com/UAVCAN/libcanard.git
[submodule "src/drivers/uavcan_v1/public_regulated_data_types"]
path = src/drivers/uavcan_v1/public_regulated_data_types
url = https://github.com/UAVCAN/public_regulated_data_types.git
[submodule "src/drivers/uavcannode_gps_demo/public_regulated_data_types"]
path = src/drivers/uavcannode_gps_demo/public_regulated_data_types
url = https://github.com/UAVCAN/public_regulated_data_types.git
[submodule "src/drivers/uavcannode_gps_demo/libcanard"]
path = src/drivers/uavcannode_gps_demo/libcanard
url = https://github.com/UAVCAN/libcanard.git
[submodule "src/drivers/uavcan_v1/legacy_data_types"]
path = src/drivers/uavcan_v1/legacy_data_types
url = https://github.com/PX4/public_regulated_data_types.git
branch = legacy
language: cpp
git:
depth: 100
submodules: false
matrix:
fast_finish: true
include:
- os: linux
dist: xenial
# In order to stay under the coverity rate limit, we only run this weekly
# and not on push which is configured in travis-ci settings.
if: branch = master
before_install:
- echo -n | openssl s_client -connect scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-
install:
- export PATH=$HOME/.local/bin:$PATH
- pip install --user --upgrade pip
- pip install --user -r Tools/setup/requirements.txt
script:
- make
addons:
coverity_scan:
project:
name: "PX4/Firmware"
description: "Build submitted via Travis CI"
notification_email: ci@px4.io
build_command_prepend: "make distclean"
build_command: "make px4_sitl_default"
branch_pattern: coverity_scan
.cortex-debug.peripherals.state.json
.cortex-debug.registers.state.json
compile_commands.json
# generated by cmake
launch.json
# C/C++ extension does some local caching in this folder
ipch/
browse.vc.db*
{
"configurations": [
{
"name": "PX4",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [],
"macFrameworkPath": [],
"configurationProvider": "ms-vscode.cmake-tools",
"cppStandard": "c++14",
"cStandard": "c11"
}
],
"version": 4
}
\ No newline at end of file
[
{
"name": "PX4 detect"
}
]
\ No newline at end of file
CONFIG:
default: px4_sitl_default
choices:
px4_sitl_default:
short: px4_sitl
buildType: RelWithDebInfo
settings:
CONFIG: px4_sitl_default
px4_sitl_replay:
short: px4_sitl_replay
buildType: RelWithDebInfo
settings:
CONFIG: px4_sitl_replay
px4_sitl_test:
short: px4_sitl_test
buildType: RelWithDebInfo
settings:
CONFIG: px4_sitl_test
px4_io-v2_default:
short: px4_io-v2
buildType: MinSizeRel
settings:
CONFIG: px4_io-v2_default
px4_fmu-v2_default:
short: px4_fmu-v2
buildType: MinSizeRel
settings:
CONFIG: px4_fmu-v2_default
px4_fmu-v3_default:
short: px4_fmu-v3
buildType: MinSizeRel
settings:
CONFIG: px4_fmu-v3_default
px4_fmu-v4_default:
short: px4_fmu-v4
buildType: MinSizeRel
settings:
CONFIG: px4_fmu-v4_default
px4_fmu-v4pro_default:
short: px4_fmu-v4pro
buildType: MinSizeRel
settings:
CONFIG: px4_fmu-v4pro_default
px4_fmu-v5_default:
short: px4_fmu-v5
buildType: MinSizeRel
settings:
CONFIG: px4_fmu-v5_default
px4_fmu-v5x_default:
short: px4_fmu-v5x
buildType: MinSizeRel
settings:
CONFIG: px4_fmu-v5x_default
airmind_mindpx-v2_default:
short: airmind_mindpx-v2
buildType: MinSizeRel
settings:
CONFIG: airmind_mindpx-v2_default
ark_can-flow_default:
short: ark_can-flow_default
buildType: MinSizeRel
settings:
CONFIG: ark_can-flow_default
ark_can-flow_canbootloader:
short: ark_can-flow_canbootloader
buildType: MinSizeRel
settings:
CONFIG: ark_can-flow_canbootloader
ark_can-gps_default:
short: ark_can-gps_default
buildType: MinSizeRel
settings:
CONFIG: ark_can-gps_default
ark_can-gps_canbootloader:
short: ark_can-gps_canbootloader
buildType: MinSizeRel
settings:
CONFIG: ark_can-gps_canbootloader
av_x-v1_default:
short: av_x-v1
buildType: MinSizeRel
settings:
CONFIG: av_x-v1_default
bitcraze_crazyflie_default:
short: bitcraze_crazyflie
buildType: MinSizeRel
settings:
CONFIG: bitcraze_crazyflie_default
cuav_can-gps-v1_default:
short: cuav_can-gps-v1_default
buildType: MinSizeRel
settings:
CONFIG: cuav_can-gps-v1_default
cuav_can-gps-v1_canbootloader:
short: cuav_can-gps-v1_canbootloader
buildType: MinSizeRel
settings:
CONFIG: cuav_can-gps-v1_canbootloader
cuav_nora_default:
short: cuav_nora
buildType: MinSizeRel
settings:
CONFIG: cuav_nora_default
cuav_x7pro_default:
short: cuav_x7pro
buildType: MinSizeRel
settings:
CONFIG: cuav_x7pro_default
cubepilot_cubeorange_test:
short: cubepilot_cubeorange
buildType: MinSizeRel
settings:
CONFIG: cubepilot_orange_test
emlid_navio2_default:
short: emlid_navio2
buildType: MinSizeRel
settings:
CONFIG: emlid_navio2_default
freefly_can-rtk-gps_default:
short: freefly_can-rtk-gps_default
buildType: MinSizeRel
settings:
CONFIG: freefly_can-rtk-gps_default
freefly_can-rtk-gps_canbootloader:
short: freefly_can-rtk-gps_canbootloader
buildType: MinSizeRel
settings:
CONFIG: freefly_can-rtk-gps_canbootloader
holybro_can-gps-v1_canbootloader:
short: holybro_can-gps-v1_canbootloader
buildType: MinSizeRel
settings:
CONFIG: holybro_can-gps-v1_canbootloader
holybro_can-gps-v1_default:
short: holybro_can-gps-v1_default
buildType: MinSizeRel
settings:
CONFIG: holybro_can-gps-v1_default
holybro_durandal-v1_default:
short: holybro_durandal-v1
buildType: MinSizeRel
settings:
CONFIG: holybro_durandal-v1_default
modalai_fc-v1_default:
short: modalai_fc-v1
buildType: MinSizeRel
settings:
CONFIG: modalai_fc-v1_default
modalai_fc-v2_default:
short: modalai_fc-v2
buildType: MinSizeRel
settings:
CONFIG: modalai_fc-v2_default
mro_ctrl-zero-f7_default:
short: mro_ctrl-zero-f7
buildType: MinSizeRel
settings:
CONFIG: mro_ctrl-zero-f7_default
mro_pixracerpro_bootloader:
short: mro_pixracerpro_bootloader
buildType: MinSizeRel
settings:
CONFIG: mro_pixracerpro_bootloader
mro_pixracerpro_default:
short: mro_pixracerpro_default
buildType: MinSizeRel
settings:
CONFIG: mro_pixracerpro_default
mro_x21-777_default:
short: mro_x2.1-777
buildType: MinSizeRel
settings:
CONFIG: mro_x21-777_default
nxp_fmuk66-v3_default:
short: nxp_fmuk66-v3
buildType: MinSizeRel
settings:
CONFIG: nxp_fmuk66-v3_default
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"chiehyu.vscode-astyle",
"dan-c-underwood.arm",
"fredericbonnet.cmake-test-adapter",
"github.vscode-pull-request-github",
"marus25.cortex-debug",
"ms-azuretools.vscode-docker",
"ms-iot.vscode-ros",
"ms-python.python",
"ms-vscode.cmake-tools",
"ms-vscode.cpptools",
"ms-vscode.cpptools-extension-pack",
"redhat.vscode-yaml",
"streetsidesoftware.code-spell-checker",
"twxs.cmake",
"uavcan.dsdl",
"wholroyd.jinja",
"zixuanwang.linkerscript"
]
}
{
"astyle.astylerc": "${workspaceFolder}/Tools/astyle/astylerc",
"astyle.c.enable": true,
"astyle.cpp.enable": true,
"breadcrumbs.enabled": true,
"C_Cpp.autoAddFileAssociations": false,
"C_Cpp.clang_format_fallbackStyle": "none",
"C_Cpp.default.browse.limitSymbolsToIncludedHeaders": true,
"C_Cpp.default.cppStandard": "c++14",
"C_Cpp.default.cStandard": "c11",
"C_Cpp.formatting": "Disabled",
"C_Cpp.intelliSenseEngine": "Default",
"C_Cpp.vcpkg.enabled": false,
"C_Cpp.workspaceParsingPriority": "low",
"cmake.buildBeforeRun": true,
"cmake.buildDirectory": "${workspaceFolder}/build/${variant:CONFIG}",
"cmake.buildTask": true,
"cmake.configureOnOpen": true,
"cmake.ctest.parallelJobs": 1,
"cmake.skipConfigureIfCachePresent": true,
"cmakeExplorer.buildDir": "${workspaceFolder}/build/px4_sitl_test",
"cmakeExplorer.parallelJobs": 1,
"cmakeExplorer.suiteDelimiter": "-",
"cortex-debug.enableTelemetry": false,
"cSpell.allowCompoundWords": true,
"cSpell.diagnosticLevel": "Hint",
"cSpell.showStatus": false,
"cSpell.words": [
"acro",
"nuttx",
"esc"
],
"debug.toolBarLocation": "docked",
"editor.acceptSuggestionOnEnter": "off",
"editor.defaultFormatter": "chiehyu.vscode-astyle",
"editor.dragAndDrop": false,
"editor.insertSpaces": false,
"editor.minimap.maxColumn": 120,
"editor.minimap.renderCharacters": false,
"editor.minimap.showSlider": "always",
"editor.suggest.localityBonus": true,
"editor.tabSize": 8,
"editor.wordWrapColumn": 120,
"explorer.openEditors.visible": 0,
"files.insertFinalNewline": true,
"files.trimTrailingWhitespace": true,
"files.watcherExclude": {
"**/build/**": true
},
"git.detectSubmodulesLimit": 20,
"git.ignoreLimitWarning": true,
"githubPullRequests.defaultMergeMethod": "squash",
"githubPullRequests.telemetry.enabled": false,
"files.associations": {
"*.jinja": "jinja",
"algorithm": "cpp",
"array": "cpp",
"atomic": "cpp",
"bitset": "cpp",
"cctype": "cpp",
"cfenv": "cpp",
"chrono": "cpp",
"cinttypes": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"codecvt": "cpp",
"complex": "cpp",
"condition_variable": "cpp",
"csignal": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdint": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"deque": "cpp",
"exception": "cpp",
"forward_list": "cpp",
"fstream": "cpp",
"functional": "cpp",
"future": "cpp",
"hash_map": "cpp",
"hash_set": "cpp",
"initializer_list": "cpp",
"iomanip": "cpp",
"iosfwd": "cpp",
"iostream": "cpp",
"istream": "cpp",
"iterator": "cpp",
"limits": "cpp",
"list": "cpp",
"map": "cpp",
"memory": "cpp",
"memory_resource": "cpp",
"mutex": "cpp",
"new": "cpp",
"numeric": "cpp",
"optional": "cpp",
"ostream": "cpp",
"random": "cpp",
"ratio": "cpp",
"regex": "cpp",
"set": "cpp",
"sstream": "cpp",
"stdexcept": "cpp",
"streambuf": "cpp",
"string": "cpp",
"string_view": "cpp",
"strstream": "cpp",
"system_error": "cpp",
"thread": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"typeindex": "cpp",
"typeinfo": "cpp",
"unordered_map": "cpp",
"unordered_set": "cpp",
"utility": "cpp",
"valarray": "cpp",
"variant": "cpp",
"vector": "cpp"
},
"search.exclude": {
"${workspaceFolder}/build": true
},
"search.showLineNumbers": true,
"telemetry.enableTelemetry": false,
"terminal.integrated.copyOnSelection": true,
"terminal.integrated.rightClickBehavior": "paste",
"terminal.integrated.scrollback": 5000,
"window.title": "${dirty} ${activeEditorMedium}${separator}${rootName}",
"workbench.editor.highlightModifiedTabs": true,
"workbench.enableExperiments": false,
"workbench.settings.enableNaturalLanguageSearch": false,
"yaml.schemas": {
"${workspaceFolder}/validation/module_schema.yaml": "${workspaceFolder}/src/modules/*/module.yaml"
}
}
This diff is collapsed. Click to expand it.
# This file is NOT licensed under the GPLv3, which is the license for the rest
# of YouCompleteMe.
#
# Here's the license text for this file:
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any purpose, commercial or non-commercial, and by any
# means.
#
# In jurisdictions that recognize copyright laws, the author or authors
# of this software dedicate any and all copyright interest in the
# software to the public domain. We make this dedication for the benefit
# of the public at large and to the detriment of our heirs and
# successors. We intend this dedication to be an overt act of
# relinquishment in perpetuity of all present and future rights to this
# software under copyright law.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
#
# For more information, please refer to <http://unlicense.org/>
import os
import ycm_core
# These are the compilation flags that will be used in case there's no
# compilation database set (by default, one is not set).
# CHANGE THIS LIST OF FLAGS. YES, THIS IS THE DROID YOU HAVE BEEN LOOKING FOR.
flags = [
'-Wall',
'-Wextra',
'-Werror',
#'-Wc++98-compat',
'-Wno-long-long',
'-Wno-variadic-macros',
'-fexceptions',
'-DNDEBUG',
# You 100% do NOT need -DUSE_CLANG_COMPLETER in your flags; only the YCM
# source code needs it.
#'-DUSE_CLANG_COMPLETER',
# THIS IS IMPORTANT! Without a "-std=<something>" flag, clang won't know which
# language to use when compiling headers. So it will guess. Badly. So C++
# headers will be compiled as C headers. You don't want that so ALWAYS specify
# a "-std=<something>".
# For a C project, you would set this to something like 'c99' instead of
# 'c++14'.
'-std=c++14',
# ...and the same thing goes for the magic -x option which specifies the
# language that the files to be compiled are written in. This is mostly
# relevant for c++ headers.
# For a C project, you would set this to 'c' instead of 'c++'.
'-x',
'c++',
'-undef', # get rid of standard definitions to allow us to include arm math header
'-I', os.path.join(os.path.expanduser("~"),'gcc-arm-none-eabi-4_7-2013q3/arm-none-eabi/include'),
'-I', 'Build/px4_io-v2_default.build/nuttx-export/include/',
'-I', './NuttX/nuttx/arch/arm/include',
'-include', './src/include/visibility.h',
'-I', './src',
'-I', './src/modules',
'-I', './src/include',
'-I', './src/lib',
'-I', './NuttX',
]
# Set this to the absolute path to the folder (NOT the file!) containing the
# compile_commands.json file to use that instead of 'flags'. See here for
# more details: http://clang.llvm.org/docs/JSONCompilationDatabase.html
#
# Most projects will NOT need to set this to anything; you can just change the
# 'flags' list of compilation flags. Notice that YCM itself uses that approach.
compilation_database_folder = ''
if os.path.exists( compilation_database_folder ):
database = ycm_core.CompilationDatabase( compilation_database_folder )
else:
database = None
SOURCE_EXTENSIONS = [ '.cpp', '.cxx', '.cc', '.c', '.m', '.mm' ]
def DirectoryOfThisScript():
return os.path.dirname( os.path.abspath( __file__ ) )
def MakeRelativePathsInFlagsAbsolute( flags, working_directory ):
if not working_directory:
return list( flags )
new_flags = []
make_next_absolute = False
path_flags = [ '-isystem', '-I', '-iquote', '--sysroot=' ]
for flag in flags:
new_flag = flag
if make_next_absolute:
make_next_absolute = False
if not flag.startswith( '/' ):
new_flag = os.path.join( working_directory, flag )
for path_flag in path_flags:
if flag == path_flag:
make_next_absolute = True
break
if flag.startswith( path_flag ):
path = flag[ len( path_flag ): ]
new_flag = path_flag + os.path.join( working_directory, path )
break
if new_flag:
new_flags.append( new_flag )
return new_flags
def IsHeaderFile( filename ):
extension = os.path.splitext( filename )[ 1 ]
return extension in [ '.h', '.hxx', '.hpp', '.hh' ]
def GetCompilationInfoForFile( filename ):
# The compilation_commands.json file generated by CMake does not have entries
# for header files. So we do our best by asking the db for flags for a
# corresponding source file, if any. If one exists, the flags for that file
# should be good enough.
if IsHeaderFile( filename ):
basename = os.path.splitext( filename )[ 0 ]
for extension in SOURCE_EXTENSIONS:
replacement_file = basename + extension
if os.path.exists( replacement_file ):
compilation_info = database.GetCompilationInfoForFile(
replacement_file )
if compilation_info.compiler_flags_:
return compilation_info
return None
return database.GetCompilationInfoForFile( filename )
def FlagsForFile( filename, **kwargs ):
if database:
# Bear in mind that compilation_info.compiler_flags_ does NOT return a
# python list, but a "list-like" StringVec object
compilation_info = GetCompilationInfoForFile( filename )
if not compilation_info:
return None
final_flags = MakeRelativePathsInFlagsAbsolute(
compilation_info.compiler_flags_,
compilation_info.compiler_working_dir_ )
# NOTE: This is just for YouCompleteMe; it's highly likely that your project
# does NOT need to remove the stdlib flag. DO NOT USE THIS IN YOUR
# ycm_extra_conf IF YOU'RE NOT 100% SURE YOU NEED IT.
#try:
# final_flags.remove( '-stdlib=libc++' )
#except ValueError:
# pass
else:
relative_to = DirectoryOfThisScript()
final_flags = MakeRelativePathsInFlagsAbsolute( flags, relative_to )
return {
'flags': final_flags,
'do_cache': True
}