maybe with coverage #4
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
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
paths: | |
- '.github/workflows/build-and-test.yml' | |
- 'src/geoarrow_geos/**' | |
- 'CMakeLists.txt' | |
name: Build and Test | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt install -y cmake valgrind lcov libgeos-dev | |
- name: Build | |
run: | | |
mkdir build | |
cd build | |
cmake .. -DCMAKE_BUILD_TYPE=Debug -DGEOARROW_GEOS_CODE_COVERAGE=ON -DGEOARROW_GEOS_BUILD_TESTS=ON | |
cmake --build . | |
- name: Test | |
run: | | |
cd build | |
GEOARROW_TESTING_DIR=$GITHUB_WORKSPACE/testing ctest -T test --output-on-failure . | |
- name: Calculate coverage | |
run: | | |
cd build | |
lcov --capture --directory . \ | |
--exclude "*_test.cc" \ | |
--exclude "/usr/*" \ | |
--exclude "*/gtest/*" \ | |
--exclude "*/nanoarrow.*" \ | |
--output-file coverage.info | |
lcov --list coverage.info | |
# - name: Upload coverage | |
# if: success() | |
# uses: codecov/codecov-action@v2 | |
# with: | |
# files: build/coverage.info | |
- name: Test with memcheck | |
run: | | |
cd build | |
ctest -T memcheck . | |
- name: Upload memcheck results | |
if: failure() | |
uses: actions/upload-artifact@main | |
with: | |
name: geoarrow-geos-memcheck | |
path: build/Testing/Temporary/MemoryChecker.*.log |