forked from eliaskosunen/scnlib
-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (44 loc) · 1.63 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: Code coverage
on: [ push, pull_request ]
jobs:
codecov:
runs-on: ubuntu-latest
env:
CXX: g++-8
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Create Build Environment
run: |
sudo locale-gen en_US.UTF-8
sudo locale-gen fi_FI.UTF-8
sudo update-locale
sudo locale -a
sudo apt-get install -yq --no-install-suggests --no-install-recommends --force-yes g++-8
mkdir ${{ runner.workspace }}/lcov
mkdir ${{ runner.workspace }}/build
- name: Setup lcov
working-directory: ${{ runner.workspace }}/lcov
shell: bash
run: |
wget http://downloads.sourceforge.net/ltp/lcov-1.14.tar.gz
tar xvfz lcov-1.14.tar.gz
make -C lcov-1.14
sudo make -C lcov-1.14 install
- name: Build
working-directory: ${{ runner.workspace }}/build
run: |
cmake -DSCN_BUILD_LOCALIZED_TESTS=ON -DSCN_COVERAGE=ON -DSCN_BENCHMARKS=OFF -DSCN_EXAMPLES=OFF $GITHUB_WORKSPACE
make -k -j2
- name: Generate Coverage Report
working-directory: ${{ runner.workspace }}/build
run: |
ctest
lcov --gcov-tool /usr/bin/gcov-8 --directory . --capture --output-file coverage.info
lcov --gcov-tool /usr/bin/gcov-8 --remove coverage.info '/usr/*' 'test/*' 'src/deps/*' --output-file coverage.info
lcov --gcov-tool /usr/bin/gcov-8 --list coverage.info
- name: Upload Coverage Report
uses: codecov/codecov-action@v2
with:
directory: ${{ runner.workspace }}/build