From 06db4b9227a8b7dbf6c1f50ea809d6e89e9c84ab Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Sat, 25 Jan 2020 16:06:33 +0100 Subject: [PATCH] MAVSDK tests: Enable coverage testing This enables minimal coverage testing for multicopters. --- .github/workflows/sitl_tests_coverage.yml | 30 ++++++++++++++++++++--- codecov.yml | 30 +++++++++++++++++++++++ 2 files changed, 56 insertions(+), 4 deletions(-) create mode 100644 codecov.yml diff --git a/.github/workflows/sitl_tests_coverage.yml b/.github/workflows/sitl_tests_coverage.yml index f36ea56e8e..0cfc398242 100644 --- a/.github/workflows/sitl_tests_coverage.yml +++ b/.github/workflows/sitl_tests_coverage.yml @@ -10,13 +10,35 @@ jobs: - uses: actions/checkout@v1 with: token: ${{ secrets.ACCESS_TOKEN }} + # see https://github.com/actions/checkout/issues/14 + - 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: get submodules + run: 'git submodule update --init --recursive' + - name: Set Python 3 as default + run: update-alternatives --install /usr/bin/python python /usr/bin/python3 10 - name: Install psutil run: pip3 install psutil -# TODO: disabled 2019-01-09 due to failures -# - name: Run simulation tests -# run: make tests_integration_coverage - - name: Upload coverage to Codecov + # - name: Download newer mavsdk + # run: git clone https://github.com/mavlink/MAVSDK.git && cd MAVSDK && git submodule init && git submodule update && mkdir -p build/default + # - name: Build newer mavsdk + # run: mkdir -p MAVSDK/build/default && cd MAVSDK/build/default && cmake ../.. && make -j4 && make install + - name: Run Coverage Tests + run: make tests_integration_coverage + - name: Upload coverage information to Coveralls + uses: coverallsapp/github-action@master + with: + path-to-lcov: coverage/lcov.info + github-token: ${{ secrets.GITHUB_TOKEN }} + - name: Upload coverage information to Codecov uses: codecov/codecov-action@v1 with: token: ${{ secrets.CODECOV_TOKEN }} flags: mavsdk + file: coverage/lcov.info diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000000..1304d99d2b --- /dev/null +++ b/codecov.yml @@ -0,0 +1,30 @@ +codecov: + require_ci_to_pass: yes + +coverage: + precision: 2 + round: down + range: "70...100" + + status: + project: yes + patch: yes + changes: no + +parsers: + gcov: + branch_detection: + conditional: yes + loop: yes + method: no + macro: no + +comment: + layout: "reach,diff,flags,tree" + behavior: default + require_changes: no + +# fixes: +# - "platforms/::./platforms/" +# - "src/::./src/" +# - "mavlink/::./mavlink/"