diff --git a/.github/codecov.yml b/.github/codecov.yml new file mode 100644 index 00000000000..06cdb1b4980 --- /dev/null +++ b/.github/codecov.yml @@ -0,0 +1,38 @@ +codecov: + require_ci_to_pass: yes + +coverage: + precision: 2 + round: down + range: "0...100" + status: + project: + default: + # basic + target: auto + threshold: 2% + base: auto + # advanced + branches: + - master + if_not_found: success + if_ci_failed: error + informational: true + only_pulls: false + +parsers: + gcov: + branch_detection: + conditional: yes + loop: yes + method: no + macro: no + +comment: + layout: "reach,diff,flags,files,footer" + behavior: default + require_changes: no + +ignore: + - "**/tests/**" + - "**/test/**" diff --git a/.github/workflows/basic_checks.yml b/.github/workflows/basic_checks.yml index 0df1123509d..c6d49ea741f 100644 --- a/.github/workflows/basic_checks.yml +++ b/.github/workflows/basic_checks.yml @@ -204,6 +204,7 @@ jobs: TOOLCHAIN: GCC_ARM TARGET_NAME: K64F PROFILE: develop + COVERAGE_FILE: coverage.xml runs-on: ubuntu-latest container: image: ghcr.io/armmbed/mbed-os-env:master-latest @@ -225,9 +226,17 @@ jobs: run: | set -x ctest --build-and-test . build --build-generator Ninja --build-options -DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=Debug -DCOVERAGE=ON --test-command ctest - gcovr --gcov-executable gcov -r . ./build -s -e ".*\.h" --exclude-directories=${GITHUB_WORKSPACE}/build/UNITTESTS --exclude-directories=${GITHUB_WORKSPACE}/build/_deps + gcovr --gcov-executable gcov -r . ./build -s -x ${{ env.COVERAGE_FILE }} -e ".*\.h" --exclude-directories=${GITHUB_WORKSPACE}/build/UNITTESTS --exclude-directories=${GITHUB_WORKSPACE}/build/_deps ccache -s + - + name: upload coverage + uses: codecov/codecov-action@v2 + with: + token: 57166f89-22b3-4949-9488-ddd3c78123fb + files: ${{ env.COVERAGE_FILE }} + verbose: true + # Reject any changes to tools that would require a re-release of the # tools for the online compiler. frozen-tools-check: