Update README.md #59
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Code coverage (xtd.core) | |
on: | |
push: | |
branches: [ master ] | |
workflow_dispatch: | |
branches: [ master ] | |
jobs: | |
coverage: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout xtd | |
uses: actions/checkout@v2 | |
- name: Install dependencies | |
run: sudo apt-get update && sudo apt-get install -y gcovr lcov libasound2-dev libgsound-dev libgtk-3-dev libwxgtk3.2-dev | |
- name: Configure CMake | |
run: | | |
mkdir build && cd build | |
cmake .. \ | |
-DCMAKE_BUILD_TYPE=Debug \ | |
-DXTD_BUILD_CPP_STANDARD=23 \ | |
-DXTD_BUILD_WITH_CONTINUOUS_INTEGRATION_SYSTEM=ON \ | |
-DXTD_BUILD_TESTS_XTD_CORE=ON \ | |
-DXTD_BUILD_TESTS_XTD_DRAWING=OFF \ | |
-DXTD_BUILD_TESTS_XTD_FORMS=OFF \ | |
-DXTD_BUILD_TESTS_XTD_TUNIT=OFF \ | |
-DCMAKE_CXX_FLAGS="--coverage" \ | |
-DCMAKE_C_FLAGS="--coverage" | |
- name: Build xtd | |
run: cmake --build build -- -j $(nproc) | |
- name: Run tests | |
run: | | |
cd build | |
ctest --output-on-failure | |
- name: Generate coverage report with gcovr | |
run: | | |
cd build | |
gcovr --root .. \ | |
--exclude-unreachable-branches \ | |
--exclude '../docs' \ | |
--exclude '../examples' \ | |
--exclude '../src/xtd.3rdparty.*' \ | |
--exclude '../src/xtd.core.native' \ | |
--exclude '../src/xtd.core.native.*' \ | |
--exclude '../src/xtd.drawing' \ | |
--exclude '../src/xtd.drawing.native' \ | |
--exclude '../src/xtd.drawing.native.*' \ | |
--exclude '../src/xtd.forms' \ | |
--exclude '../src/xtd.forms.native' \ | |
--exclude '../src/xtd.forms.native.*' \ | |
--exclude '../src/xtd.tunit' \ | |
--exclude '../tools' \ | |
--exclude-throw-branches \ | |
--gcov-ignore-parse-errors=negative_hits.warn_once_per_file \ | |
--xml-pretty \ | |
-o coverage.xml | |
- name: Upload to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: build/coverage.xml | |
fail_ci_if_error: false | |
verbose: true | |
slug: gammasoft71/xtd |