Skip to content

Commit faba695

Browse files
andibacherCopilot
andcommitted
Add GitHub Actions Windows CI workflow for MSVC and MinGW
- Add cmake-windows.yml with matrix builds for Qt 6.2.4, 6.5.3, 6.6.3, 6.7.3, 6.8.3, 6.9.1 - Two jobs: MSVC (Ninja) and MinGW (MinGW Makefiles) - Run ctest after build - Add workflow file to CMakeLists.txt githubworkflows target Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 7406782 commit faba695

2 files changed

Lines changed: 80 additions & 1 deletion

File tree

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: CMake Windows build and test
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
workflow_dispatch:
9+
10+
env:
11+
BUILD_TYPE: Release
12+
13+
jobs:
14+
build-msvc:
15+
name: MSVC - Qt ${{ matrix.qt_version }}
16+
runs-on: windows-latest
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
qt_version: [6.2.4, 6.5.3, 6.6.3, 6.7.3, 6.8.3, 6.9.1]
21+
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- name: Install Qt
26+
uses: jurplel/install-qt-action@v4
27+
with:
28+
version: ${{ matrix.qt_version }}
29+
30+
- name: Setup MSVC
31+
uses: ilammy/msvc-dev-cmd@v1
32+
33+
- name: Create Build Environment
34+
run: cmake -E make_directory ${{ runner.workspace }}/build
35+
36+
- name: Configure CMake
37+
working-directory: ${{ runner.workspace }}/build
38+
run: cmake ${{ github.workspace }} -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -GNinja
39+
40+
- name: Build
41+
working-directory: ${{ runner.workspace }}/build
42+
run: cmake --build . --config ${{ env.BUILD_TYPE }}
43+
44+
- name: Test
45+
working-directory: ${{ runner.workspace }}/build
46+
run: ctest -C ${{ env.BUILD_TYPE }} --output-on-failure
47+
48+
build-mingw:
49+
name: MinGW - Qt ${{ matrix.qt_version }}
50+
runs-on: windows-latest
51+
strategy:
52+
fail-fast: false
53+
matrix:
54+
qt_version: [6.2.4, 6.5.3, 6.6.3, 6.7.3, 6.8.3, 6.9.1]
55+
56+
steps:
57+
- uses: actions/checkout@v4
58+
59+
- name: Install Qt
60+
uses: jurplel/install-qt-action@v4
61+
with:
62+
version: ${{ matrix.qt_version }}
63+
arch: win64_mingw
64+
65+
- name: Create Build Environment
66+
run: cmake -E make_directory ${{ runner.workspace }}/build
67+
68+
- name: Configure CMake
69+
working-directory: ${{ runner.workspace }}/build
70+
run: cmake ${{ github.workspace }} -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -G "MinGW Makefiles"
71+
72+
- name: Build
73+
working-directory: ${{ runner.workspace }}/build
74+
run: cmake --build . --config ${{ env.BUILD_TYPE }}
75+
76+
- name: Test
77+
working-directory: ${{ runner.workspace }}/build
78+
run: ctest -C ${{ env.BUILD_TYPE }} --output-on-failure

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,8 @@ endif()
150150

151151
# githob workflow files
152152
add_custom_target(githubworkflows SOURCES
153-
".github/workflows/cmake-ubuntu.yml")
153+
".github/workflows/cmake-ubuntu.yml"
154+
".github/workflows/cmake-windows.yml")
154155

155156
# Create a proper FindLog4Qt - module
156157
set(CMAKECONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/Log4Qt" )

0 commit comments

Comments
 (0)