-
Notifications
You must be signed in to change notification settings - Fork 215
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #729, Add local and bundle unit test action with coverage verific…
…ation
- Loading branch information
Showing
2 changed files
with
47 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: "Local Unit Test" | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
|
||
Local-Unit-Test: | ||
runs-on: ubuntu-18.04 | ||
timeout-minutes: 15 | ||
|
||
steps: | ||
- name: Install cppcheck | ||
run: sudo apt-get install lcov -y | ||
|
||
- name: Checkout submodule | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up for build | ||
run: | | ||
cp Makefile.sample Makefile | ||
make ENABLE_UNIT_TESTS=true PERMISSIVE_MODE=true prep | ||
- name: Build the code | ||
run: make -j | ||
|
||
# Baseline lcov and run all tests | ||
- name: Test | ||
run: | | ||
make test | ||
- name: Calculate coverage | ||
run: | | ||
make lcov | tee lcov_out.txt | ||
- name: Confirm 100% line coverage | ||
run: | | ||
if [[ `grep -A 3 "Overall coverage rate" lcov_out.txt | grep lines` != *"100.0%"* ]]; then | ||
grep -A 3 "Overall coverage rate" lcov_out.txt | ||
echo "Lacks 100.0% line unit test coverage" | ||
exit -1 | ||
fi |