mirror of https://github.com/koide3/small_gicp.git
Coverage (#4)
* coverage ci * separate build and test * install lcov * overwrite coverage.info * change directory * exclude benchmark and example * python cov report * local only * upload python coverage --------- Co-authored-by: k.koide <k.koide@aist.go.jp>
This commit is contained in:
parent
c020c0d1f1
commit
4334429893
|
|
@ -0,0 +1,55 @@
|
|||
name: Coverage
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master, coverage ]
|
||||
paths-ignore: '**.md'
|
||||
pull_request:
|
||||
branches: [ master, coverage ]
|
||||
paths-ignore: '**.md'
|
||||
|
||||
# Allows you to run this workflow manually from the Actions tab
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
coverage:
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
token: ${{ secrets.GH_PAT }}
|
||||
submodules: recursive
|
||||
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
sudo apt-get -y update
|
||||
sudo apt-get install -y build-essential cmake python3-pip pybind11-dev libeigen3-dev libfmt-dev libtbb-dev libomp-dev libpcl-dev libgtest-dev lcov
|
||||
pip install -U setuptools pytest pytest-cov numpy scipy
|
||||
|
||||
- name: Build (C++)
|
||||
run: |
|
||||
mkdir build && cd build
|
||||
cmake .. -DBUILD_TESTS=ON -DBUILD_EXAMPLES=ON -DBUILD_BENCHMARKS=ON -DBUILD_WITH_TBB=ON -DBUILD_WITH_PCL=ON -DENABLE_COVERAGE=ON
|
||||
make -j$(nproc)
|
||||
|
||||
- name: Test (C++)
|
||||
run: |
|
||||
cd build
|
||||
ctest -j$(nproc)
|
||||
make coverage
|
||||
|
||||
- name: Build (Python)
|
||||
run: |
|
||||
python3 setup.py build && python3 setup.py install --user
|
||||
|
||||
- name: Test (Python)
|
||||
run: |
|
||||
pytest src/example/basic_registration.py --cov=src --cov-report=xml
|
||||
|
||||
- name: Upload coverage reports to Codecov
|
||||
uses: codecov/codecov-action@v4.0.1
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
slug: koide3/small_gicp
|
||||
files: build/coverage.info,coverage.xml
|
||||
|
|
@ -45,8 +45,8 @@ if(ENABLE_COVERAGE)
|
|||
|
||||
add_custom_target(coverage
|
||||
COMMAND ${LCOV} --directory . --capture --output-file coverage.info
|
||||
COMMAND ${LCOV} --remove coverage.info -o filtered_coverage.info '/usr/*'
|
||||
COMMAND ${GENHTML} --demangle-cpp -o coverage filtered_coverage.info
|
||||
COMMAND ${LCOV} --remove coverage.info -o coverage.info '/usr/*'
|
||||
COMMAND ${GENHTML} --demangle-cpp -o coverage coverage.info
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
|
||||
endif()
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue