Skip to content

Commit

Permalink
check if works
Browse files Browse the repository at this point in the history
  • Loading branch information
chhwang committed Oct 26, 2023
1 parent f688204 commit 0d87ced
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/ut-backup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: InstallLcov
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends lcov
- name: Build
run: |
mkdir build && cd build
Expand Down Expand Up @@ -51,3 +56,16 @@ jobs:
set -e
cd build && make pylib-copy
mpirun --allow-run-as-root -tag-output -np 8 $(which pytest) ../python/test/test_mscclpp.py -x
- name: ReportCoverage
run: |
cd build
lcov --capture --directory . --output-file coverage.info
lcov --remove coverage.info \
'/usr/*' \
'/tmp/*' \
'*/python/*' \
'*/test/*' \
'*/tools/*' \
--output-file coverage.info
lcov --list coverage.info
12 changes: 12 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@ set(CMAKE_CUDA_STANDARD 17)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -Xcompiler -Wall,-Wextra")

# Code coverage from https://github.com/codecov/example-cpp11-cmake
add_library(coverage_config INTERFACE)
if(CMAKE_BUILD_TYPE MATCHES "Debug" AND CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
# Add required flags (GCC & LLVM/Clang)
target_compile_options(coverage_config INTERFACE
-O0 # no optimization
-g # generate debug info
--coverage # sets all required flags
)
target_link_options(coverage_config INTERFACE --coverage)
endif()

list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)

# Format targets
Expand Down

0 comments on commit 0d87ced

Please sign in to comment.