Skip to content

create coverage actions #8

create coverage actions

create coverage actions #8

Workflow file for this run

name: Coverage Report
on:
pull_request:
branches: [ "develop" ]
workflow_run:
workflows: ["tests"]
types:
- completed
jobs:
test-coverage:
runs-on: ubuntu-22.04
steps:
- name: Install apt packages
run: sudo apt-get install -y build-essential cmake git uuid-dev faketime locales python3 curl gcovr ninja-build
- name: Check out this repository
uses: actions/checkout@v4.1.6
- name: Build and test this project
run: |
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS=--coverage
cmake --build build --target build_tests
ctest --test-dir build -j 8 --output-on-failure --rerun-failed
- name: Generate a code coverage report
uses: threeal/gcovr-action@xml-out
with:
xml-out: coverage.cobertura.xml
excludes: |
build
- name: Code Coverage Summary Report
uses: irongut/CodeCoverageSummary@v1.3.0
with:
filename: coverage.cobertura.xml
badge: true
format: markdown
output: both
hide_complexity: true
- 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