mirror of
https://github.com/red0124/ssp.git
synced 2025-01-23 13:05:20 +01:00
72 lines
1.7 KiB
YAML
72 lines
1.7 KiB
YAML
name: coverage-ci
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
|
|
push:
|
|
branches:
|
|
- master
|
|
- feature/**
|
|
- improvement/**
|
|
- bugfix/**
|
|
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
- feature/**
|
|
- improvement/**
|
|
- bugfix/**
|
|
|
|
jobs:
|
|
test_coverage:
|
|
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
|
|
|
|
- name: Install test coverage tools
|
|
run: |
|
|
apt update
|
|
apt install -y gcovr lcov
|
|
|
|
- name: Configure
|
|
run: cmake -S test -B build -D CMAKE_BUILD_TYPE=Debug -D CMAKE_CXX_FLAGS="-Wall -fprofile-arcs -ftest-coverage --coverage -fno-elide-constructors -fno-default-inline"
|
|
|
|
- name: Build
|
|
run: cmake --build build -j ${{steps.cores.outputs.count}}
|
|
|
|
- name: Run
|
|
working-directory: build
|
|
run: ctest --output-on-failure
|
|
|
|
- name: Generate coverage report
|
|
run: |
|
|
lcov -d . -c -o out.info --rc lcov_branch_coverage=1 --no-external
|
|
lcov -e out.info '*include/ss*hpp' -o filtered.info
|
|
|
|
- name: Invoke coveralls
|
|
uses: coverallsapp/github-action@v2
|
|
with:
|
|
github-token: ${{secrets.GITHUB_TOKEN}}
|
|
file: filtered.info
|
|
format: lcov
|