Skip to content

Commit

Permalink
add integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
shapiromatron committed May 30, 2024
1 parent ab91838 commit 93258bb
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 13 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/cpp-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: C++ test linux

on:
pull_request:
push:
branches:
- main
workflow_dispatch:

jobs:
test:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install dependencies and build
run: |
source ./scripts/linux_ci.sh
mkdir -p src/build
cd src/build
cmake ..
make -j$(nproc)
make run_tests_with_coverage
12 changes: 2 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ExternalProject_Add(
GIT_TAG "80dc998efced8ceb2be59756668a7e90e8bef917" # v2.10.4
SOURCE_DIR "${CMAKE_BINARY_DIR}/third-party/pybind11"
# Override default steps with no action, we just want the clone step.
UPDATE_COMMAND ""
UPDATE_COMMAND ""
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
Expand Down Expand Up @@ -39,9 +39,6 @@ ENDIF()
IF(DEFINED ENV{CMAKE_CXX_COMPILER})
set(CMAKE_CXX_COMPILER $ENV{CMAKE_CXX_COMPILER})
ENDIF()
IF(DEFINED ENV{PYTHON_LIBRARY_DIR})
set(PYTHON_LIBRARY_DIR $ENV{PYTHON_LIBRARY_DIR})
ENDIF()

IF(WIN32)
add_compile_definitions(RBMDS_EXPORTS)
Expand Down Expand Up @@ -76,7 +73,7 @@ file (GLOB PYTHON_FILES "src/pybmdscpp/*.cpp" "src/pybmdscpp/*.h")
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${SOURCE_FILES} ${HEADER_FILES} ${PYTHON_FILES} )

include(pybind11.cmake)
pybind11_add_module(bmdscore
pybind11_add_module(bmdscore
${SOURCE_FILES}
${HEADER_FILES}
${PYTHON_FILES}
Expand All @@ -87,8 +84,3 @@ IF(WIN32)
ELSE()
target_link_libraries(bmdscore PUBLIC GSL::gsl GSL::gslcblas ${NLOPT_LIB})
ENDIF(WIN32)

install(TARGETS bmdscore
COMPONENT python
LIBRARY DESTINATION "${PYTHON_LIBRARY_DIR}"
)
4 changes: 1 addition & 3 deletions tools/linux_ci.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
#!/bin/bash

sudo apt-get update -y
sudo apt-get install -y automake build-essential libtool make cmake libgslcblas0 libgsl-dev libeigen3-dev libnlopt-dev libnlopt-cxx-dev
sudo apt-get install -y automake build-essential libtool make cmake libgslcblas0 libgsl-dev libeigen3-dev libnlopt-dev libnlopt-cxx-dev lcov

export "EIGEN_DIR=/usr/include/eigen3"
export "NLOPT_DIR=/usr/lib/x86_64-linux-gnu/"
export "CMAKE_C_COMPILER=/usr/bin/gcc-12"
export "CMAKE_CXX_COMPILER=/usr/bin/g++-12"
export "PYTHON_EXECUTABLE=$Python3_ROOT_DIR/bin/python"
export "PYTHON_LIBRARY_DIR=$Python3_ROOT_DIR/lib/python3.11/site-packages"

0 comments on commit 93258bb

Please sign in to comment.