forked from Koihik/LuaFormatter
-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (35 loc) · 1.19 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
name: Coverage
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Add g++-9 ppa
run: |
sudo add-apt-repository 'ppa:ubuntu-toolchain-r/test'
sudo apt update
- name: Install g++-9
run: |
sudo apt install g++-9
- name: Install lcov 1.15
run: |
sudo apt install perl libjson-perl libperlio-gzip-perl
git clone --depth=1 https://github.com/linux-test-project/lcov.git
cd lcov
sudo make install
cd ..
- name: Build LuaFormatter
run: |
git submodule update --init
mkdir build
cd build
CXX='g++-9' cmake .. -DCMAKE_BUILD_TYPE=Debug
make
CTEST_OUTPUT_ON_FAILURE=1 ctest
- name: Run lcov and upload to codecov
run: |
lcov --directory . --capture --output-file coverage.info --gcov-tool /usr/bin/gcov-9;
lcov --remove coverage.info '*/usr/*' '*/test/*' '*/generated/*' '*/third_party/*' --output-file coverage.info;
lcov --list coverage.info;
bash <(curl -s https://codecov.io/bash) -t ${{ secrets.CODECOV_TOKEN }} || echo "Codecov did not collect coverage reports";