Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[c++] Extend codecov to cover tiledbsoma library #1970

Merged
merged 1 commit into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
30 changes: 30 additions & 0 deletions .github/workflows/libtiledb-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: libTileDB-SOMA CodeCov

on:
pull_request:
paths-ignore:
- "apis/python/**"
- "apis/r/**"
- ".pre-commit-config.yaml"
push:
branches:
- main
- 'release-*'
workflow_dispatch:

jobs:
codecov:
runs-on: macos-latest
steps:
- name: Checkout TileDB-SOMA
uses: actions/checkout@v3
- name: Build libTileDB-SOMA
run: TILEDBSOMA_COVERAGE="--coverage" ./scripts/bld
nguyenv marked this conversation as resolved.
Show resolved Hide resolved
- name: Run libTileDB-SOMA unittests
run: ctest --test-dir build/libtiledbsoma -C Release --verbose --rerun-failed --output-on-failur
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
gcov: true
flags: libtiledbsoma
gcov_include: $(find libtiledbsoma -name "*.h" -or -name "*.cc")
7 changes: 7 additions & 0 deletions libtiledbsoma/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ message(STATUS "Starting TileDB-SOMA build.")

set(TILEDBSOMA_INSTALL_TARGETS "")

# ###########################################################
# Adding coverage flags
# ###########################################################

set(CMAKE_CXX_FLAGS "$ENV{TILEDBSOMA_COVERAGE}")
set(CMAKE_C_FLAGS "$ENV{TILEDBSOMA_COVERAGE}")

# ###########################################################
# Find required dependencies
# See ../cmake/Modules/*.cmake for provenance/version info
Expand Down
6 changes: 6 additions & 0 deletions libtiledbsoma/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
get_filename_component(TILEDBSOMA_SOURCE_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/../../" ABSOLUTE)
add_compile_definitions(TILEDBSOMA_SOURCE_ROOT="${TILEDBSOMA_SOURCE_ROOT}")

# ###########################################################
# Adding coverage flags
# ###########################################################
set(CMAKE_CXX_FLAGS "$ENV{TILEDBSOMA_COVERAGE}")
set(CMAKE_C_FLAGS "$ENV{TILEDBSOMA_COVERAGE}")

############################################################
# Dependencies
############################################################
Expand Down
11 changes: 7 additions & 4 deletions scripts/bld
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,10 @@ cd "$(dirname "$0")/.."

rm -rf build
mkdir -p build
cmake -B build -S libtiledbsoma -DCMAKE_BUILD_TYPE=${build} ${extra_opts}
cmake --build build -j ${nproc}
cmake --build build --target install-libtiledbsoma
cmake --build build/libtiledbsoma --target build_tests -j ${nproc}

if [ -z ${TILEDBSOMA_COVERAGE+x} ]; then TILEDBSOMA_COVERAGE=""; fi

TILEDBSOMA_COVERAGE="${TILEDBSOMA_COVERAGE}" cmake -B build -S libtiledbsoma -DCMAKE_BUILD_TYPE=${build} ${extra_opts}
TILEDBSOMA_COVERAGE="${TILEDBSOMA_COVERAGE}" cmake --build build -j ${nproc}
TILEDBSOMA_COVERAGE="${TILEDBSOMA_COVERAGE}" cmake --build build --target install-libtiledbsoma
TILEDBSOMA_COVERAGE="${TILEDBSOMA_COVERAGE}" cmake --build build/libtiledbsoma --target build_tests -j ${nproc}
Loading