Skip to content

Release 2024.5.0

Release 2024.5.0 #537

Workflow file for this run

name: Coverage
on:
push:
branches: [ master, main ]
pull_request:
branches: [ '**' ]
jobs:
coverage-linux:
name: Coverage
runs-on: ubuntu-latest
env:
SCCACHE_GHA_ENABLED: "true"
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Run sccache-cache
uses: mozilla-actions/[email protected]
- name: Install dependencies
run: |
sudo apt-get install ninja-build
pip install gcovr
gcovr --version
- name: Install Conan
run: |
pip install conan
conan profile detect
conan remote update --url https://center2.conan.io conancenter
- name: Setup
run: |
conan install . -s compiler.cppstd=20 -s build_type=Debug -b missing \
-o with_wheel=True -o with_service=True -o with_httplib=True
- name: Configure
run: |
cmake --preset conan-debug \
-DCMAKE_CXX_FLAGS=" -fprofile-arcs -ftest-coverage " \
-DCMAKE_EXE_LINKER_FLAGS=" --coverage -lgcov " \
-DMAPGET_ENABLE_TESTING=YES \
-DWITH_COVERAGE=YES \
-GNinja
- name: Build
run: |
cmake --build --preset conan-debug
- name: Run Test
run: |
ctest --preset conan-debug -C Debug --verbose --no-tests=error
- name: Run Gcovr
run: |
mkdir coverage
gcovr --html-details coverage/coverage.html \
--filter libs/ \
--gcov-ignore-parse-errors=negative_hits.warn_once_per_file
gcovr --cobertura coverage.xml \
--html coverage.html \
--filter libs/ \
--gcov-ignore-parse-errors=negative_hits.warn_once_per_file
- name: Publish Coverage HTML
uses: actions/upload-artifact@v3
with:
name: Test Coverage
path: coverage
# - name: Upload coverage HTML to Gist
# # Upload only for main branch
# if: >
# github.event_name == 'workflow_run' && github.event.workflow_run.head_branch == 'main' ||
# github.event_name != 'workflow_run' && github.ref == 'refs/heads/main'
# uses: andymckay/append-gist-action@1fbfbbce708a39bd45846f0955ed5521f2099c6d
# with:
# token: ${{ secrets.GIST_TOKEN }}
# gistURL: https://gist.githubusercontent.com/johannes-wolf/61e57af50757b03e0c7cd119ec2d2f4b
# file: coverage.html
- name: Code Coverage Report
uses: irongut/[email protected]
with:
filename: coverage.xml
badge: false
fail_below_min: true
format: markdown
hide_branch_rate: false
hide_complexity: true
indicators: true
output: both
thresholds: '50 80'
- name: Add Coverage PR Comment
uses: marocchino/sticky-pull-request-comment@v2
if: github.event_name == 'pull_request'
with:
recreate: true
path: code-coverage-results.md