-
Notifications
You must be signed in to change notification settings - Fork 22
37 lines (34 loc) · 1.02 KB
/
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
# Measure code coverage using Codecov
name: coverage
on:
push:
branches: master
pull_request:
branches: master
jobs:
run:
name: Measure code coverage
runs-on: ubuntu-latest
steps:
- name: Install lcov
run: sudo apt install -y lcov
- name: Get source
uses: actions/checkout@v3
- name: Configure CMake
run: >
CC=gcc cmake -B ${{github.workspace}}/build
-DCMAKE_BUILD_TYPE=Coverage
- name: Build
run: cmake --build ${{github.workspace}}/build
- name: Run tests
working-directory: ${{github.workspace}}/build
run: |
lcov -c -i -d src -d cmd -o coverage_base.info
test/testbee2
cd cmd && cp ../../cmd/test/* . && ./test.sh
- name: Upload coverage reports to Codecov
working-directory: ${{github.workspace}}/build
run: |
lcov -c -d src -d cmd -o coverage_test.info
lcov -a coverage_base.info -a coverage_test.info -o coverage.info
bash <(curl -s https://codecov.io/bash) -f coverage.info