-
Notifications
You must be signed in to change notification settings - Fork 21
63 lines (49 loc) · 1.7 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
59
60
61
62
63
name: Code Coverage
on:
push:
branches:
- master
- dev
workflow_dispatch:
jobs:
gen_cov_report:
name: Gen Code Cov Report
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
build_config: [Debug, Release]
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Install suitable compiler
run: sudo apt-get install g++-10
- name: Install ninja
uses: seanmiddleditch/gha-setup-ninja@master
- name: Install CMake
uses: jwlawson/[email protected]
with:
cmake-version: '3.15.0'
- name: Install lcov
run: sudo apt-get install lcov
- name: Setup Compiler
run: |
echo "CC=gcc-10" >> $GITHUB_ENV
echo "CXX=g++-10" >> $GITHUB_ENV
- name: Generate Project
run: cmake -B Build/${{ matrix.build_config }} -DCMAKE_BUILD_TYPE=${{ matrix.build_config }} -DRFK_DEV=1 -DRFK_GEN_CODECOV_REPORT=1 -G "Ninja"
- name: Build Refureku
run: cmake --build Build/${{ matrix.build_config }} --config ${{ matrix.build_config }} --target RefurekuTests --verbose
- name: Run Tests
run: cd Build/${{ matrix.build_config }} && ctest -R RefurekuTests -C ${{ matrix.build_config }} -V
- name: Generate coverage report
run: lcov --directory Build/${{ matrix.build_config }} --capture --output-file coverage.info
- name: Upload coverage to codecov
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.info
fail_ci_if_error: true
verbose: true