Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
7c3560a
Added code coverage upload job to CI workflow
Brandon-Kimberly Jun 16, 2020
df4286d
Created codecov.yml
Brandon-Kimberly Jun 16, 2020
ffa72fa
Fixed codecov job
Brandon-Kimberly Jun 16, 2020
6eefc24
Adjusted codecov job to run tests
Brandon-Kimberly Jun 16, 2020
f4139b2
Added setup portion to code coverage job
Brandon-Kimberly Jun 16, 2020
5b13fd9
Fixed syntax error
Brandon-Kimberly Jun 16, 2020
bf36455
Added new target for codecov
Brandon-Kimberly Jun 16, 2020
e025457
Increased goal range for coverage
Brandon-Kimberly Jun 16, 2020
92a63b1
Combined run tests and upload coverage jobs
Brandon-Kimberly Jun 16, 2020
8125775
Added lcov to generate coverage reports
Brandon-Kimberly Jun 17, 2020
591423c
Moved codecov config file
Brandon-Kimberly Jun 17, 2020
491114b
Added file path fixing
Brandon-Kimberly Jun 17, 2020
a61bee0
Moved codecov yaml file
Brandon-Kimberly Jun 17, 2020
483a565
Revert previous commit
Brandon-Kimberly Jun 17, 2020
b67d65b
Specify yaml file location
Brandon-Kimberly Jun 17, 2020
9d6c5a0
Moved report upload step to workflow job
Brandon-Kimberly Jun 17, 2020
a821e76
Fixed syntax error
Brandon-Kimberly Jun 17, 2020
a3cf07c
Specify file path to coverage report
Brandon-Kimberly Jun 17, 2020
7262784
Changed target dir for coverage report
Brandon-Kimberly Jun 17, 2020
071f128
Changed target dir for coverage report
Brandon-Kimberly Jun 17, 2020
84f9030
Changed path to coverage report upload
Brandon-Kimberly Jun 17, 2020
a9f9b5d
Removed echo debug statement
Brandon-Kimberly Jun 17, 2020
8ef9f05
Added code.coverage job description to README
Brandon-Kimberly Jun 17, 2020
0f3ee89
Added comments about file path fixing
Brandon-Kimberly Jun 18, 2020
c6ad30b
Fix minor typo
Brandon-Kimberly Jun 18, 2020
e1631e3
Merge branch 'master' into master
Brandon-Kimberly Jun 18, 2020
82b37fc
Merge branch 'master' into master
reyang Jun 19, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/.codecov.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
codecov:
require_ci_to_pass: yes
max_report_age: off

coverage:
precision: 2
round: down
range: "80...100"

parsers:
gcov:
branch_detection:
conditional: yes
loop: yes
method: no
macro: no

comment:
layout: "reach,diff,flags,tree"
behavior: default
require_changes: no

# Relative file path fixing.
# CI file paths must match Git file paths.
# This fix removes the "/home/runner/" prefix
# to coverage report file paths.
fixes:
- "/home/runner/::"
16 changes: 16 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,3 +182,19 @@ jobs:
./ci/setup_windows_ci_environment.ps1
- name: run tests
run: ./ci/do_ci.ps1 cmake.test_example_plugin

code_coverage:
name: Code coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: setup
run: |
sudo ./ci/setup_cmake.sh
sudo ./ci/setup_ci_environment.sh
- name: run tests and generate report
run: ./ci/do_ci.sh code.coverage
- name: upload report
uses: codecov/codecov-action@v1
with:
file: /home/runner/build/coverage.info
1 change: 1 addition & 0 deletions ci/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ CI tests can be run on docker by invoking the script `./ci/run_docker.sh ./ci/do
* `bazel.tsan`: build bazel targets and run tests with ThreadSanitizer.
* `benchmark`: run all benchmarks.
* `format`: use `tools/format.sh` to enforce text formatting.
* `code.coverage`: build cmake targets and run tests. Then upload coverage report to [codecov.io](https://codecov.io/).

Additionally, `./ci/run_docker.sh` can be invoked with no arguments to get a docker shell where tests
can be run manually.
10 changes: 10 additions & 0 deletions ci/do_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,16 @@ elif [[ "$1" == "format" ]]; then
exit 1
fi
exit 0
elif [[ "$1" == "code.coverage" ]]; then
cd "${BUILD_DIR}"
rm -rf *
cmake -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_FLAGS="-Werror --coverage" \
"${SRC_DIR}"
make
make test
lcov --directory $PWD --capture --output-file coverage.info
exit 0
fi

echo "Invalid do_ci.sh target, see ci/README.md for valid targets."
Expand Down
1 change: 1 addition & 0 deletions ci/setup_ci_environment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ apt-get install --no-install-recommends --no-install-suggests -y \
ca-certificates \
wget \
git
apt-get install -y lcov