2019-12-17 04:34:22 -04:00
|
|
|
name: SITL Tests
|
|
|
|
|
2020-01-28 15:37:06 -04:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2022-09-07 01:09:44 -03:00
|
|
|
- 'main'
|
2020-01-28 15:37:06 -04:00
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- '*'
|
2019-12-17 04:34:22 -04:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
2020-03-29 15:11:22 -03:00
|
|
|
strategy:
|
2020-06-20 16:24:30 -03:00
|
|
|
fail-fast: false
|
2020-03-29 15:11:22 -03:00
|
|
|
matrix:
|
2020-06-20 16:24:30 -03:00
|
|
|
config:
|
2021-12-22 03:43:04 -04:00
|
|
|
- {model: "iris", latitude: "59.617693", longitude: "-151.145316", altitude: "48", build_type: "RelWithDebInfo" } # Alaska
|
2022-12-12 15:23:13 -04:00
|
|
|
# - {model: "standard_vtol", latitude: "-38.071235", longitude: "145.281220", altitude: "31", build_type: "AddressSanitizer" } # Australia
|
2021-12-22 03:43:04 -04:00
|
|
|
- {model: "tailsitter" , latitude: "29.660316", longitude: "-82.316658", altitude: "30", build_type: "RelWithDebInfo" } # Florida
|
|
|
|
- {model: "standard_vtol", latitude: "47.397742", longitude: "8.545594", altitude: "488", build_type: "Coverage" } # Zurich
|
2021-06-04 10:19:45 -03:00
|
|
|
|
2020-04-08 12:52:35 -03:00
|
|
|
container:
|
2021-09-08 09:03:50 -03:00
|
|
|
image: px4io/px4-dev-simulation-focal:2021-09-08
|
2020-04-08 12:52:35 -03:00
|
|
|
options: --privileged --ulimit core=-1 --security-opt seccomp=unconfined
|
2019-12-17 04:34:22 -04:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v1
|
2019-12-26 07:59:09 -04:00
|
|
|
with:
|
|
|
|
token: ${{ secrets.ACCESS_TOKEN }}
|
2020-06-20 14:18:06 -03:00
|
|
|
|
2020-01-23 10:55:33 -04:00
|
|
|
- name: Download MAVSDK
|
2022-04-20 07:25:56 -03:00
|
|
|
run: wget "https://github.com/mavlink/MAVSDK/releases/download/v$(cat test/mavsdk_tests/MAVSDK_VERSION)/libmavsdk-dev_$(cat test/mavsdk_tests/MAVSDK_VERSION)_ubuntu20.04_amd64.deb"
|
2020-01-23 10:55:33 -04:00
|
|
|
- name: Install MAVSDK
|
2022-04-20 07:25:56 -03:00
|
|
|
run: dpkg -i "libmavsdk-dev_$(cat test/mavsdk_tests/MAVSDK_VERSION)_ubuntu20.04_amd64.deb"
|
2020-06-20 14:18:06 -03:00
|
|
|
|
|
|
|
- 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
|
2020-06-20 14:26:29 -03:00
|
|
|
uses: actions/cache@v2
|
2020-03-10 18:33:46 -03:00
|
|
|
with:
|
|
|
|
path: ~/.ccache
|
2020-06-20 19:57:35 -03:00
|
|
|
key: sitl_tests-${{matrix.config.build_type}}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}}
|
|
|
|
restore-keys: sitl_tests-${{matrix.config.build_type}}-ccache-
|
2020-03-10 18:33:46 -03:00
|
|
|
- name: setup ccache
|
2020-06-20 14:18:06 -03:00
|
|
|
run: |
|
|
|
|
mkdir -p ~/.ccache
|
|
|
|
echo "base_dir = ${GITHUB_WORKSPACE}" > ~/.ccache/ccache.conf
|
|
|
|
echo "compression = true" >> ~/.ccache/ccache.conf
|
2021-10-06 00:31:19 -03:00
|
|
|
echo "compression_level = 6" >> ~/.ccache/ccache.conf
|
2021-02-22 19:36:01 -04:00
|
|
|
echo "max_size = 100M" >> ~/.ccache/ccache.conf
|
2021-10-06 00:45:22 -03:00
|
|
|
echo "hash_dir = false" >> ~/.ccache/ccache.conf
|
2020-06-20 14:18:06 -03:00
|
|
|
ccache -s
|
|
|
|
ccache -z
|
|
|
|
|
2020-06-20 16:24:30 -03:00
|
|
|
- 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}}
|
2020-11-19 12:07:47 -04:00
|
|
|
run: |
|
|
|
|
export
|
|
|
|
ulimit -a
|
2020-06-20 16:24:30 -03:00
|
|
|
- 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}}
|
2023-01-15 12:36:12 -04:00
|
|
|
run: make px4_sitl_default sitl_gazebo-classic
|
|
|
|
- name: ccache post-run sitl_gazebo-classic
|
2020-06-20 16:24:30 -03:00
|
|
|
run: ccache -s
|
|
|
|
- name: Build MAVSDK tests
|
|
|
|
env:
|
|
|
|
PX4_CMAKE_BUILD_TYPE: ${{matrix.config.build_type}}
|
|
|
|
DONT_RUN: 1
|
2023-01-15 12:36:12 -04:00
|
|
|
run: make px4_sitl_default sitl_gazebo-classic mavsdk_tests
|
2020-06-20 16:24:30 -03:00
|
|
|
- name: ccache post-run mavsdk_tests
|
2020-06-20 14:18:06 -03:00
|
|
|
run: ccache -s
|
|
|
|
|
2020-04-08 12:52:35 -03:00
|
|
|
- name: Core dump settings
|
|
|
|
run: |
|
|
|
|
ulimit -c unlimited
|
2020-04-09 08:07:36 -03:00
|
|
|
echo "`pwd`/%e.core" > /proc/sys/kernel/core_pattern
|
2020-06-20 14:18:06 -03:00
|
|
|
|
2020-03-05 11:41:20 -04:00
|
|
|
- name: Run SITL tests
|
2020-06-20 16:24:30 -03:00
|
|
|
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}}
|
2021-12-02 08:06:30 -04:00
|
|
|
run: test/mavsdk_tests/mavsdk_test_runner.py --speed-factor 20 --abort-early --model ${{matrix.config.model}} --upload test/mavsdk_tests/configs/sitl.json --verbose
|
2021-10-06 14:47:12 -03:00
|
|
|
timeout-minutes: 45
|
2020-06-20 14:18:06 -03:00
|
|
|
|
2020-04-09 07:55:03 -03:00
|
|
|
- name: Look at core files
|
|
|
|
if: failure()
|
2020-04-09 08:07:36 -03:00
|
|
|
run: gdb build/px4_sitl_default/bin/px4 px4.core -ex "thread apply all bt" -ex "quit"
|
2020-04-09 07:55:03 -03:00
|
|
|
- name: Upload px4 coredump
|
|
|
|
if: failure()
|
2020-04-09 08:46:31 -03:00
|
|
|
uses: actions/upload-artifact@v2-preview
|
2020-04-09 07:55:03 -03:00
|
|
|
with:
|
|
|
|
name: coredump
|
2020-04-09 08:07:36 -03:00
|
|
|
path: px4.core
|
2020-06-20 14:18:06 -03:00
|
|
|
|
2020-04-09 07:55:03 -03:00
|
|
|
- name: Upload px4 binary
|
|
|
|
if: failure()
|
2020-04-09 08:46:31 -03:00
|
|
|
uses: actions/upload-artifact@v2-preview
|
2020-04-09 07:55:03 -03:00
|
|
|
with:
|
|
|
|
name: binary
|
|
|
|
path: build/px4_sitl_default/bin/px4
|
2020-01-30 06:57:48 -04:00
|
|
|
|
|
|
|
# Report test coverage
|
2020-06-20 16:24:30 -03:00
|
|
|
- name: Upload coverage
|
2020-06-20 19:57:35 -03:00
|
|
|
if: contains(matrix.config.build_type, 'Coverage')
|
2020-01-30 06:57:48 -04:00
|
|
|
run: |
|
2020-06-20 16:24:30 -03:00
|
|
|
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
|
2020-01-30 06:57:48 -04:00
|
|
|
- name: Upload coverage information to Codecov
|
2020-06-20 19:57:35 -03:00
|
|
|
if: contains(matrix.config.build_type, 'Coverage')
|
2020-01-30 06:57:48 -04:00
|
|
|
uses: codecov/codecov-action@v1
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
|
|
flags: mavsdk
|
|
|
|
file: coverage/lcov.info
|