2019-12-17 04:34:22 -04:00
|
|
|
name: SITL Tests
|
|
|
|
|
2020-01-28 15:37:06 -04:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- 'master'
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- '*'
|
2019-12-17 04:34:22 -04:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
2020-03-16 12:55:08 -03:00
|
|
|
container: px4io/px4-dev-simulation-bionic:2020-03-16
|
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-01-23 10:55:33 -04:00
|
|
|
- name: Download MAVSDK
|
2020-01-30 06:57:48 -04:00
|
|
|
run: wget https://github.com/mavlink/MAVSDK/releases/download/v0.24.0/mavsdk_0.24.0_ubuntu18.04_amd64.deb
|
2020-01-23 10:55:33 -04:00
|
|
|
- name: Install MAVSDK
|
2020-01-30 06:57:48 -04:00
|
|
|
run: dpkg -i mavsdk_0.24.0_ubuntu18.04_amd64.deb
|
2020-03-10 18:33:46 -03:00
|
|
|
- uses: actions/cache@v1.1.0
|
|
|
|
id: ccache-persistence
|
|
|
|
with:
|
|
|
|
path: ~/.ccache
|
|
|
|
key: ccache-sitl-tests
|
|
|
|
restore-keys: |
|
|
|
|
ccache-sitl-tests
|
|
|
|
- name: setup ccache
|
|
|
|
run: mkdir -p ~/.ccache && echo "max_size = 1G" > ~/.ccache/ccache.conf && ccache -z && ccache -s
|
2019-12-24 05:58:21 -04:00
|
|
|
- name: Build PX4 in SITL integration test mode
|
2020-01-30 06:57:48 -04:00
|
|
|
run: DONT_RUN=1 make px4_sitl PX4_CMAKE_BUILD_TYPE=Coverage gazebo mavsdk_tests
|
2020-03-10 18:33:46 -03:00
|
|
|
- name: ccache post-run
|
|
|
|
run: ccache -s && ccache -z
|
2020-03-05 11:41:20 -04:00
|
|
|
- name: Run SITL tests
|
|
|
|
run: test/mavsdk_tests/mavsdk_test_runner.py --speed-factor 20 --abort-early test/mavsdk_tests/configs/sitl.json
|
2020-03-18 07:50:45 -03:00
|
|
|
- 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
|
2020-01-30 06:57:48 -04:00
|
|
|
|
|
|
|
# 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
|
|
|
|
run: |
|
|
|
|
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
|
|
|
|
uses: codecov/codecov-action@v1
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
|
|
flags: mavsdk
|
|
|
|
file: coverage/lcov.info
|