From 7fac2fe6cd553c0a6be5b6f633257a2439e13c4e Mon Sep 17 00:00:00 2001 From: Julian Kent Date: Wed, 27 Jan 2021 16:08:19 +0100 Subject: [PATCH] Consolidate uploading of coverage info for unit tests --- .github/workflows/checks.yml | 8 ++++ .github/workflows/coverage.yml | 69 ---------------------------------- 2 files changed, 8 insertions(+), 69 deletions(-) delete mode 100644 .github/workflows/coverage.yml diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index a10b13a58a..61c6dd46b1 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -17,6 +17,7 @@ jobs: check: [ "check_format", "tests", + "tests_coverage", "px4_fmu-v2_default stack_check", "validate_module_configs", "shellcheck_all", @@ -61,3 +62,10 @@ jobs: 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 diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml deleted file mode 100644 index 3623a2b859..0000000000 --- a/.github/workflows/coverage.yml +++ /dev/null @@ -1,69 +0,0 @@ -name: Coverage - -on: - push: - branches: - - 'master' - pull_request: - branches: - - '*' - -jobs: - build: - runs-on: ubuntu-latest - container: - image: px4io/px4-dev-base-focal:2020-11-18 - options: --privileged --ulimit core=-1 --security-opt seccomp=unconfined - strategy: - matrix: - config: [ - tests, - #python_coverage, - ] - 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: coverage_${{matrix.config}}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}} - restore-keys: coverage_${{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 = 6" >> ~/.ccache/ccache.conf - echo "max_size = 100M" >> ~/.ccache/ccache.conf - ccache -s - ccache -z - - - name: make ${{matrix.config}} - env: - PX4_CMAKE_BUILD_TYPE: "Coverage" - run: make ${{matrix.config}} - - # Report test coverage - - name: Upload 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_test --base-directory build/px4_sitl_test --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: ${{matrix.config}} - file: coverage/lcov.info