Skip to content

Commit 960ceb5

Browse files
committed
Updated test.yaml to ignore the Python module for the C++ tests.
Updated the C++ dependencies. Decided against switching to vcpkg for now, but may look at it again at a later date.
1 parent 65ee1bf commit 960ceb5

File tree

5 files changed

+16
-13
lines changed

5 files changed

+16
-13
lines changed

.github/workflows/build.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ jobs:
2525
virtualenvs-create: true
2626
virtualenvs-in-project: true
2727
- name: Install Python dependencies
28-
run: |
29-
poetry --version
30-
poetry install --no-interaction
28+
run: poetry install --no-interaction
3129
- name: Build the game
3230
run: python -m build --executable
3331
- name: Upload the release

.github/workflows/test.yaml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,19 +45,23 @@ jobs:
4545
steps:
4646
- name: Checkout repository
4747
uses: actions/checkout@v4.1.1
48+
- name: Set up MSVC
49+
uses: ilammy/msvc-dev-cmd@v1.12.1
4850
- name: Set up CMake
4951
uses: lukka/get-cmake@v3.27.7
50-
- name: Configure and build CMake
52+
- name: Build CMake and run CTest
5153
working-directory: ${{ github.workspace }}/src/hades_extensions
5254
run: |
53-
cmake --preset Coverage
55+
cmake -DDO_PYTHON=OFF --preset Coverage
5456
cmake --build build-coverage
55-
- name: Run CTest and generate the coverage report
57+
ctest --output-on-failure --no-tests=error --test-dir ${{ github.workspace }}/src/hades_extensions/build-coverage/tests
58+
- name: Generate the coverage report
59+
if: matrix.os == 'ubuntu-latest'
5660
run: |
5761
pip install gcovr
58-
ctest --output-on-failure --no-tests=error --test-dir ${{ github.workspace }}/src/hades_extensions/build-coverage/tests
5962
gcovr -r ${{ github.workspace }} --exclude src/hades_extensions/build-coverage --exclude src/hades_extensions/tests --exclude src/hades_extensions/src/binding.cpp --coveralls coverage.json
6063
- name: Upload coverage report
64+
if: matrix.os == 'ubuntu-latest'
6165
uses: coverallsapp/github-action@v2.2.3
6266
with:
6367
file: coverage.json

src/hades_extensions/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
66
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
77
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
88
set(ENABLE_COVERAGE OFF CACHE BOOL "Enable coverage reporting for GCC/Clang")
9-
set(ENABLE_STATIC_ANALYSIS OFF CACHE BOOL "Enable static analysis using clang-tidy")
9+
set(DO_PYTHON ON CACHE BOOL "Enable Python bindings")
1010
set(DO_TESTS ON CACHE BOOL "Enable testing")
1111

1212
# Define the module names and initialise the project
@@ -40,6 +40,5 @@ if (DO_TESTS)
4040
add_subdirectory(tests)
4141
endif ()
4242

43-
# TODO: maybe add vcpkg to the c++ project
4443
# TODO: maybe switch to catch2
4544
# TODO: maybe change the components to pass by value and use std::move to signify that ownership is being transferred (or find another way)

src/hades_extensions/src/CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ find_package(Python COMPONENTS Interpreter Development REQUIRED)
33
FetchContent_Declare(
44
pybind11_source
55
GIT_REPOSITORY https://github.com/pybind/pybind11.git
6-
GIT_TAG v2.10.3
6+
GIT_TAG v2.11.1
77
)
88
FetchContent_GetProperties(pybind11_source)
99
FetchContent_Populate(pybind11_source)
@@ -30,5 +30,7 @@ add_library(${CPP_LIB} STATIC
3030
target_include_directories(${CPP_LIB} PUBLIC ${CMAKE_SOURCE_DIR}/include)
3131

3232
# Create the Python module
33-
pybind11_add_module(${PY_MODULE} ${CMAKE_SOURCE_DIR}/src/binding.cpp)
34-
target_link_libraries(${PY_MODULE} PRIVATE ${CPP_LIB})
33+
if (DO_PYTHON)
34+
pybind11_add_module(${PY_MODULE} ${CMAKE_SOURCE_DIR}/src/binding.cpp)
35+
target_link_libraries(${PY_MODULE} PRIVATE ${CPP_LIB})
36+
endif ()

src/hades_extensions/tests/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
FetchContent_Declare(
33
googletest
44
GIT_REPOSITORY https://github.com/google/googletest.git
5-
GIT_TAG v1.13.0
5+
GIT_TAG v1.14.0
66
)
77
set(gtest_force_shared_crt ON CACHE BOOL "Always use msvcrt.dll" FORCE)
88
FetchContent_MakeAvailable(googletest)

0 commit comments

Comments
 (0)