|
|
|
@ -12,13 +12,15 @@ jobs:
@@ -12,13 +12,15 @@ jobs:
|
|
|
|
|
build: |
|
|
|
|
runs-on: ubuntu-latest |
|
|
|
|
strategy: |
|
|
|
|
fail-fast: false |
|
|
|
|
matrix: |
|
|
|
|
ubuntu_release: [ |
|
|
|
|
#bionic, |
|
|
|
|
focal |
|
|
|
|
] |
|
|
|
|
config: |
|
|
|
|
- {latitude: "59.617693", longitude: "-151.145316", altitude: "48", build_type: "RelWithDebInfo"} # Alaska |
|
|
|
|
- {latitude: "-38.071235", longitude: "145.281220", altitude: "31", build_type: "RelWithDebInfo"} # Australia |
|
|
|
|
- {latitude: "29.660316", longitude: "-82.316658", altitude: "30", build_type: "RelWithDebInfo"} # Florida |
|
|
|
|
- {latitude: "47.397742", longitude: "8.545594", altitude: "488", build_type: "Coverage"} # Zurich |
|
|
|
|
container: |
|
|
|
|
image: px4io/px4-dev-simulation-${{ matrix.ubuntu_release }}:2020-04-01 |
|
|
|
|
image: px4io/px4-dev-simulation-focal:2020-04-01 |
|
|
|
|
options: --privileged --ulimit core=-1 --security-opt seccomp=unconfined |
|
|
|
|
steps: |
|
|
|
|
- uses: actions/checkout@v1 |
|
|
|
@ -40,8 +42,8 @@ jobs:
@@ -40,8 +42,8 @@ jobs:
|
|
|
|
|
uses: actions/cache@v2 |
|
|
|
|
with: |
|
|
|
|
path: ~/.ccache |
|
|
|
|
key: sitl_tests_${{matrix.ubuntu_release}}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}} |
|
|
|
|
restore-keys: sitl_tests_${{matrix.ubuntu_release}}-ccache- |
|
|
|
|
key: sitl_tests-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}} |
|
|
|
|
restore-keys: sitl_tests-ccache- |
|
|
|
|
- name: setup ccache |
|
|
|
|
run: | |
|
|
|
|
mkdir -p ~/.ccache |
|
|
|
@ -52,9 +54,31 @@ jobs:
@@ -52,9 +54,31 @@ jobs:
|
|
|
|
|
ccache -s |
|
|
|
|
ccache -z |
|
|
|
|
|
|
|
|
|
- name: Build PX4 in SITL integration test mode |
|
|
|
|
run: DONT_RUN=1 make px4_sitl PX4_CMAKE_BUILD_TYPE=Coverage gazebo mavsdk_tests |
|
|
|
|
- name: ccache post-run |
|
|
|
|
- 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 |
|
|
|
|
- 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 |
|
|
|
@ -63,22 +87,18 @@ jobs:
@@ -63,22 +87,18 @@ jobs:
|
|
|
|
|
echo "`pwd`/%e.core" > /proc/sys/kernel/core_pattern |
|
|
|
|
|
|
|
|
|
- name: Run SITL tests |
|
|
|
|
run: test/mavsdk_tests/mavsdk_test_runner.py --speed-factor 20 --abort-early test/mavsdk_tests/configs/sitl.json |
|
|
|
|
|
|
|
|
|
- name: Run SITL tests in Southern hemisphere |
|
|
|
|
run: PX4_HOME_LAT=-37.8134048 PX4_HOME_LON=175.304109 PX4_HOME_ALT=32 | |
|
|
|
|
test/mavsdk_tests/mavsdk_test_runner.py --speed-factor 20 --abort-early test/mavsdk_tests/configs/sitl.json |
|
|
|
|
|
|
|
|
|
- name: Run SITL tests far in the West |
|
|
|
|
run: PX4_HOME_LAT=59.6176928 PX4_HOME_LON=-151.1453163 PX4_HOME_ALT=48 | |
|
|
|
|
test/mavsdk_tests/mavsdk_test_runner.py --speed-factor 20 --abort-early test/mavsdk_tests/configs/sitl.json |
|
|
|
|
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 |
|
|
|
|
test/mavsdk_tests/mavsdk_test_runner.py --speed-factor 20 --abort-early 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 logs to flight review |
|
|
|
|
if: failure() |
|
|
|
|
run: ./Tools/upload_log.py -q --description "${GITHUB_WORKFLOW} ${GITHUB_RUN_ID}" --feedback "${GITHUB_WORKFLOW} ${GITHUB_RUN_ID} ${GITHUB_REPOSITORY} ${GITHUB_REF}" --source CI ./build/px4_sitl_default/tmp/rootfs/log/*/*.ulg |
|
|
|
|
- name: Upload px4 coredump |
|
|
|
|
if: failure() |
|
|
|
|
uses: actions/upload-artifact@v2-preview |
|
|
|
@ -86,6 +106,10 @@ jobs:
@@ -86,6 +106,10 @@ jobs:
|
|
|
|
|
name: coredump |
|
|
|
|
path: px4.core |
|
|
|
|
|
|
|
|
|
- name: Upload logs to flight review |
|
|
|
|
if: failure() |
|
|
|
|
run: ./Tools/upload_log.py -q --description "${GITHUB_WORKFLOW} ${GITHUB_RUN_ID}" --feedback "${GITHUB_WORKFLOW} ${GITHUB_RUN_ID} ${GITHUB_REPOSITORY} ${GITHUB_REF}" --source CI ./build/px4_sitl_default/tmp/rootfs/log/*/*.ulg |
|
|
|
|
|
|
|
|
|
- name: Upload px4 binary |
|
|
|
|
if: failure() |
|
|
|
|
uses: actions/upload-artifact@v2-preview |
|
|
|
@ -94,19 +118,17 @@ jobs:
@@ -94,19 +118,17 @@ jobs:
|
|
|
|
|
path: build/px4_sitl_default/bin/px4 |
|
|
|
|
|
|
|
|
|
# Report test coverage |
|
|
|
|
- name: disable the keychain credential helper |
|
|
|
|
run: git config --global credential.helper "" |
|
|
|
|
- name: enable the local store credential helper |
|
|
|
|
run: git config --global --add credential.helper store |
|
|
|
|
- name: add credential |
|
|
|
|
run: echo "https://x-access-token:${{ secrets.ACCESS_TOKEN }}@github.com" >> ~/.git-credentials |
|
|
|
|
- name: tell git to use https instead of ssh whenever it encounters it |
|
|
|
|
run: 'git config --global url."https://github.com/".insteadof git@github.com:' |
|
|
|
|
- name: Check code coverage |
|
|
|
|
- name: Upload coverage |
|
|
|
|
if: ${{matrix.config.build_type}} == 'Coverage' |
|
|
|
|
run: | |
|
|
|
|
mkdir -p coverage |
|
|
|
|
lcov --directory build/px4_sitl_default --base-directory build/px4_sitl_default --gcov-tool gcov --capture -o coverage/lcov.info |
|
|
|
|
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: ${{matrix.config.build_type}} == 'Coverage' |
|
|
|
|
uses: codecov/codecov-action@v1 |
|
|
|
|
with: |
|
|
|
|
token: ${{ secrets.CODECOV_TOKEN }} |
|
|
|
|