-
Notifications
You must be signed in to change notification settings - Fork 71
43 lines (39 loc) · 1.12 KB
/
code_coverage.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: Code Coverage
on:
pull_request:
push:
branches:
- master
env:
BUILD_TYPE: Debug
jobs:
build:
name: Coveralls
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
persist-credentials: false
- name: Download and install lcov
run: |
VERSION="1.15"
mkdir lcov_pkg && cd lcov_pkg
wget "https://github.com/linux-test-project/lcov/releases/download/v$VERSION/lcov-$VERSION.tar.gz"
tar -xzf "lcov-$VERSION.tar.gz"
cd "lcov-$VERSION"
sudo make install
- name: Configure
run: cd build && cmake .. -DCOVERAGE=ON
- name: Build unit tests
run: cmake --build build
- name: Run tests
run: cmake --build build --target test
- name: Generate coverage .info
run: cmake --build build --target coverage_report
- name: Post to Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: build/lcov.info