Skip to content

Commit 5f2fe22

Browse files
committed
ci: add debug-msvc job in the build.yml workflow
1 parent 39a7675 commit 5f2fe22

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

.github/workflows/build.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,29 @@ jobs:
4444
${{ matrix.package }}/test/*
4545
fail-under-line: 100
4646

47+
debug-msvc:
48+
runs-on: windows-latest
49+
strategy:
50+
matrix:
51+
package: [error]
52+
steps:
53+
- name: Checkout repository
54+
uses: actions/checkout@v3.5.3
55+
56+
- name: Configure CMake
57+
run: |
58+
cmake ${{ matrix.package }} \
59+
-B ${{ matrix.package }}/build \
60+
-D CMAKE_CXX_COMPILER=cl \
61+
-D CMAKE_CXX_FLAGS=/WX \
62+
-D BUILD_TESTING=ON
63+
64+
- name: Build project
65+
run: cmake --build ${{ matrix.package }}/build
66+
67+
- name: Run unit tests
68+
run: ctest --test-dir ${{ matrix.package }}/build --output-on-failure --no-tests=error
69+
4770
release:
4871
runs-on: ubuntu-latest
4972
strategy:

error/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
2626
cpmaddpackage("gh:catchorg/Catch2@3.3.2")
2727
include("${Catch2_SOURCE_DIR}/extras/Catch.cmake")
2828

29-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage -fPIC -O0")
29+
if(NOT MSVC)
30+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage -fPIC -O0")
31+
endif()
3032

3133
add_executable(error_test test/error_test.cpp)
3234
target_link_libraries(error_test PRIVATE error Catch2::Catch2WithMain)

0 commit comments

Comments
 (0)