2023-08-08 01:06:27 +02:00
|
|
|
name: coverage-ci
|
2023-08-08 00:43:02 +02:00
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
- feature/**
|
|
|
|
- improvement/**
|
|
|
|
- bugfix/**
|
|
|
|
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
- feature/**
|
|
|
|
- improvement/**
|
|
|
|
- bugfix/**
|
|
|
|
|
|
|
|
jobs:
|
2023-08-08 01:06:27 +02:00
|
|
|
test_coverage:
|
2023-08-08 00:43:02 +02:00
|
|
|
if: >-
|
|
|
|
! contains(toJSON(github.event.commits.*.message), '[skip ci]') &&
|
|
|
|
! contains(toJSON(github.event.commits.*.message), '[skip github]')
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
name: "Coverage"
|
|
|
|
|
|
|
|
container:
|
|
|
|
image: gcc:latest
|
|
|
|
options: -v /usr/local:/host_usr_local
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v1
|
|
|
|
|
|
|
|
- uses: friendlyanon/fetch-core-count@v1
|
|
|
|
id: cores
|
|
|
|
|
|
|
|
- name: CMake
|
|
|
|
run: echo "/host_usr_local/bin" >> $GITHUB_PATH
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: script/ci_install_deps.sh
|
|
|
|
|
2023-08-08 01:06:27 +02:00
|
|
|
- name: Install test coverage tools
|
|
|
|
run: |
|
|
|
|
apt update
|
|
|
|
apt install -y gcovr lcov
|
|
|
|
|
2023-08-08 00:43:02 +02:00
|
|
|
- name: Configure
|
2023-08-08 12:43:56 +02:00
|
|
|
run: cmake -S test -B build -D CMAKE_BUILD_TYPE=Debug -D CMAKE_CXX_FLAGS="-Wall -fprofile-arcs -ftest-coverage --coverage"
|
2023-08-08 00:43:02 +02:00
|
|
|
|
|
|
|
- name: Build
|
|
|
|
run: cmake --build build -j ${{steps.cores.outputs.count}}
|
|
|
|
|
|
|
|
- name: Run
|
|
|
|
working-directory: build
|
2024-02-18 14:12:10 +01:00
|
|
|
run: ctest --output-on-failure
|
2023-08-08 00:43:02 +02:00
|
|
|
|
|
|
|
- name: Generate coverage report
|
|
|
|
run: |
|
|
|
|
lcov -d . -c -o out.info --rc lcov_branch_coverage=1 --no-external
|
2023-08-08 01:12:05 +02:00
|
|
|
lcov -e out.info '*include/ss*hpp' -o filtered.info
|
2023-08-08 00:43:02 +02:00
|
|
|
|
2023-08-08 01:15:57 +02:00
|
|
|
- name: Invoke coveralls
|
2023-08-08 00:43:02 +02:00
|
|
|
uses: coverallsapp/github-action@v2
|
2023-08-08 01:12:05 +02:00
|
|
|
with:
|
|
|
|
github-token: ${{secrets.GITHUB_TOKEN}}
|
2023-08-08 01:46:20 +02:00
|
|
|
file: filtered.info
|
2023-08-08 02:03:42 +02:00
|
|
|
format: lcov
|