-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add test coverage * ci: install lcov * ci: fix test coverage lcov command option
- Loading branch information
1 parent
c50e090
commit 78d13df
Showing
5 changed files
with
76 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,3 +29,7 @@ indent_size = 4 | |
|
||
[*.{md,markdown}] | ||
indent_size = 4 | ||
|
||
[*.yml] | ||
indent_style = space | ||
indent_size = 2 |
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,61 @@ | ||
# GH actions | ||
|
||
name: test-coverage | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
env: | ||
BUILD_TYPE: Release | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Clone repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Ninja | ||
uses: seanmiddleditch/gha-setup-ninja@v3 | ||
|
||
- name: Install googletest | ||
shell: bash | ||
run: | | ||
git clone https://github.com/google/googletest --depth 1 | ||
cd googletest | ||
mkdir build && cd build | ||
cmake .. -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/googletest-install -G Ninja | ||
cmake --build . --config ${{env.BUILD_TYPE}} -j 2 | ||
cmake --install . --config ${{env.BUILD_TYPE}} | ||
- name: Install lcov | ||
run: sudo apt-get install lcov | ||
|
||
- name: Configure with CMake | ||
shell: bash | ||
run: | | ||
mkdir build | ||
cd build | ||
cmake -G Ninja .. -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DSHUFACV_TEST=ON -DSHUFACV_COVERAGE=ON -DGTest_DIR=${{github.workspace}}/googletest-install/lib/cmake/GTest | ||
- name: Building | ||
run: cmake --build build --config ${{env.BUILD_TYPE}} | ||
- name: Testing | ||
working-directory: ${{github.workspace}}/build | ||
run: ctest -C ${{env.BUILD_TYPE}} --output-on-failure | ||
|
||
- name: lcov-collect | ||
run: | | ||
cd build | ||
lcov -d . -c -o lcov.info | ||
lcov -r lcov.info '/usr/*' -o lcov.info | ||
lcov -r lcov.info '*/build/*' -o lcov.info | ||
lcov --list lcov.info | ||
- name: codecov | ||
uses: codecov/codecov-action@v2.1.0 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
file: build/lcov.info |
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 |
---|---|---|
|
@@ -38,3 +38,6 @@ __pycache__ | |
|
||
# Build dir | ||
build/ | ||
|
||
# VSCode | ||
.vscode/ |
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