-
Notifications
You must be signed in to change notification settings - Fork 117
58 lines (46 loc) · 1.85 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# This is a basic workflow that is manually triggered
name: Code Coverage
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
codacy-coverage-reporter:
runs-on: ubuntu-latest
name: codecov-coverage-reporter
steps:
#- name: Install gtest manually
# run: sudo apt-get install libgtest-dev
#- name: Install benchmark manually
# run: |
# git clone https://github.com/google/benchmark.git
# git clone https://github.com/google/googletest.git benchmark/googletest
# cd benchmark
# cmake -E make_directory "build"
# cmake -E chdir "build" cmake -DCMAKE_BUILD_TYPE=Release ../
# cmake --build "build" --config Release
# sudo cmake --build "build" --config Release --target install
- name: Update apt repo
run: sudo apt-get update
- name: Install tools manually
run: sudo apt-get install lcov gcovr
- uses: actions/checkout@v4
- name: Configure CMake
run: cmake -DTEST=ON -DCODE_COVERAGE=ON -B ${{github.workspace}}/build; sudo apt-get install lcov gcovr
- name: Build
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build
- name: run
working-directory: ${{github.workspace}}/build/test
run: ./test_exe
- name: create Report
working-directory: ${{github.workspace}}/build/test
run: lcov --capture --directory .. --output-file coverage.info
- uses: codecov/codecov-action@v3.1.4
with:
#token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
file: ${{github.workspace}}/build/test/coverage.info # optional
flags: unittests # optional
name: codecov-umbrella # optional
fail_ci_if_error: true # optional (default = false)