Skip to content

Commit 9e0d87b

Browse files
authored
Merge pull request #834 from redboltz/limit_cov_guard
Limited codecov trigger.
2 parents cc10989 + bbc03b2 commit 9e0d87b

File tree

2 files changed

+51
-7
lines changed

2 files changed

+51
-7
lines changed

.github/workflows/coverage.yml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
name: coverage
22

3-
on: push
3+
on:
4+
pull_request:
5+
types: [opened, synchronize]
6+
push:
7+
branches:
8+
- master
9+
tags:
10+
- '*'
411

512
jobs:
613

@@ -39,16 +46,17 @@ jobs:
3946
mkdir -p ${BASE}/usr/lib
4047
mv *.a ${BASE}/usr/lib
4148
cd ..
42-
49+
4350
mkdir build && cd build
4451
CMAKE_LIBRARY_PATH="${BASE}/build" GTEST_ROOT="${BASE}/usr" CMAKE_PREFIX_PATH="${BASE}/usr/gcc/lib64/cmake" cmake -DMSGPACK_CXX17=ON -DMSGPACK_32BIT=OFF -DMSGPACK_BOOST=ON -DBUILD_SHARED_LIBS=ON -DMSGPACK_CHAR_SIGN=signed -DMSGPACK_USE_X3_PARSE=ON -DMSGPACK_ENABLE_CXX=ON -DMSGPACK_BUILD_EXAMPLES=ON -DMSGPACK_BUILD_TESTS=ON -DCMAKE_BUILD_TYPE=Debug -DMSGPACK_GEN_COVERAGE=ON ..
4552
make -j4
4653
make test
4754
- name: Upload coverage to Codecov
4855
working-directory: build
49-
env:
50-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
5156
run: |
52-
wget https://codecov.io/bash -O codecov
53-
chmod +x codecov
54-
./codecov -t $CODECOV_TOKEN -B $GITHUB_REF -s .
57+
# Create lcov report
58+
lcov --capture --directory . --output-file coverage.info
59+
lcov --remove coverage.info '/usr/*' --output-file coverage.info # filter system-files
60+
lcov --list coverage.info # debug info
61+
# Uploading report to CodeCov
62+
bash <(curl -s https://codecov.io/bash) -f coverage.info || echo "Codecov did not collect coverage reports"

codecov.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
codecov:
2+
notify:
3+
require_ci_to_pass: yes
4+
5+
coverage:
6+
precision: 2
7+
round: down
8+
range: "70...100"
9+
10+
status:
11+
project: yes
12+
patch: yes
13+
changes: no
14+
15+
parsers:
16+
gcov:
17+
branch_detection:
18+
conditional: yes
19+
loop: yes
20+
method: no
21+
macro: no
22+
23+
comment:
24+
layout: "header, diff"
25+
behavior: default
26+
require_changes: no
27+
28+
ignore:
29+
- "test"
30+
- "fuzz"
31+
- "erb"
32+
- "ci"
33+
- "cmake"
34+
- "examle"
35+
- "external"
36+
- "usr"

0 commit comments

Comments
 (0)