Skip to content

Using thje right version of gcov #125

Using thje right version of gcov

Using thje right version of gcov #125

Workflow file for this run

name: code coverage
on: [push]
jobs:
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Get latest cmake
uses: lukka/get-cmake@latest
- name: Install gcovr
run: pip install gcovr
- name: Configure
env:
CXXFLAGS: --coverage -fprofile-abs-path -g -O1
CFLAGS: --coverage -fprofile-abs-path -g -O1
LDFLAGS: --coverage
CC: gcc-13
CXX: g++-13
run: cmake -S . -B build -D VCPKG_TARGET_TRIPLET=x64-linux --toolchain "${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake"
- name: Build
run: cmake --build build --parallel
- name: Execute
run: ctest --test-dir build
- uses: actions/upload-artifact@v3
with:
name: sample gcda
path: build/CMakeFiles/test_io1-money.dir/test/tutorial.cpp.gcda
- name: Create report
run: |
mkdir build/html
gcovr -v --gcov-executable /usr/bin/gcov-13 --filter include/io1/money.hpp --exclude-unreachable-branches --exclude-lines-by-pattern '.*assert.*' --print-summary -x build/coverage.xml --html-details build/html/index.html --html-details-syntax-highlighting -r . build
- uses: actions/upload-artifact@v3
with:
name: detailed coverage report
path: build/html
- uses: 5monkeys/cobertura-action@v13
with:
path: build/coverage.xml
repo_token: ${{ secrets.GITHUB_TOKEN }}
minimum_coverage: 84
fail_below_threshold: true
show_line: true
show_branch: true
show_missing: true