Skip to content

Commit

Permalink
Fix cmake check target for multi-config generators.
Browse files Browse the repository at this point in the history
Adds testing of release builds on both MSVC and GCC.
  • Loading branch information
zrax committed Aug 8, 2024
1 parent d247a2e commit 95afdfa
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/linux-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@ jobs:
- name: Configure and Build
run: |
mkdir build && cd build
cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug ..
ninja
cmake -G "Ninja Multi-Config" ..
cmake --build . --config Debug
cmake --build . --config Release
- name: Test
run: |
cd build
ninja check
cmake --build . --config Debug --target check
cmake --build . --config Release --target check
10 changes: 3 additions & 7 deletions .github/workflows/msvc-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,11 @@ jobs:
cmake --build . --config Debug
cmake --build . --config Release
# This should probably be fixed to work from MSVC without needing to
# use a bash shell and the GNU userland tools... But for now, the
# GH Actions environment provides what we need.
- name: Test
run: |
cd build\Debug
python ..\..\tests\run_tests.py
env:
PYTHON_EXE: python.exe
cd build
cmake --build . --config Debug --target check
cmake --build . --config Release --target check
- name: Upload artifact
uses: actions/upload-artifact@v3
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,6 @@ find_package(Python3 3.5 COMPONENTS Interpreter)
if(Python3_FOUND)
add_custom_target(check
COMMAND "${Python3_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/tests/run_tests.py"
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
WORKING_DIRECTORY "$<TARGET_FILE_DIR:pycdc>")
add_dependencies(check pycdc)
endif()

0 comments on commit 95afdfa

Please sign in to comment.