Skip to content

Commit 7dedb64

Browse files
committed
Run CTest on Windows via GitHub Actions
1 parent 4969d78 commit 7dedb64

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

.github/workflows/main.yml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
pull_request:
66
workflow_dispatch:
77

8+
defaults:
9+
run:
10+
shell: bash
11+
812
jobs:
913
build-autoconf:
1014
name: linux-autoconf
@@ -64,10 +68,20 @@ jobs:
6468
uses: actions/checkout@v4
6569

6670
- name: Configure (${{ matrix.configuration }})
67-
run: cmake -S . -Bbuild -DCMAKE_BUILD_TYPE=${{ matrix.configuration }} -DCMAKE_UNITY_BUILD=ON -DCMAKE_COMPILE_WARNING_AS_ERROR=ON
71+
run: |
72+
if [ "${{ matrix.compiler }}" == "msvc" ]; then
73+
cmake -S . -Bbuild -DCMAKE_UNITY_BUILD=ON -DCMAKE_COMPILE_WARNING_AS_ERROR=ON -DBUILD_TESTING=ON -DBASH_EXECUTABLE="C:/Program Files/Git/bin/bash.exe"
74+
else
75+
cmake -S . -Bbuild -DCMAKE_BUILD_TYPE=${{ matrix.configuration }} -DCMAKE_UNITY_BUILD=ON -DCMAKE_COMPILE_WARNING_AS_ERROR=ON -DBUILD_TESTING=ON
76+
fi
6877
6978
- name: Build with ${{ matrix.compiler }}
70-
run: cmake --build build
79+
run: |
80+
if [ "${{ matrix.compiler }}" == "msvc" ]; then
81+
cmake --build build --config ${{ matrix.configuration }}
82+
else
83+
cmake --build build
84+
fi
7185
7286
- name: Test
73-
run: cd build && ctest -V .
87+
run: ctest --test-dir build --build-config ${{ matrix.configuration }} --verbose

0 commit comments

Comments
 (0)