Repository navigation
90 lines (80 loc) · 3 KB
/
Copy pathc-cpp.yml
File metadata and controls
90 lines (80 loc) · 3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Qt C++
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
# ---------------------------------------------------------------------
# IMPORTANT: do NOT use `windows-latest` here.
#
# As of late 2025 `windows-latest` points to the `windows-2025-vs2026`
# image, which ships MSVC 19.51. Qt 6.5.0's `qvarlengtharray.h` still
# uses `stdext::checked_array_iterator`, an API that was removed from
# newer MSVC STL versions, so every translation unit that includes a
# Qt header fails with:
#
# error C3861: 'stdext': identifier not found
# error C2065: 'stdext': undeclared identifier
#
# `windows-2022` runs VS 2022 (MSVC 19.4x), which is the toolchain
# Qt 6.5.0 was built and tested against.
# ---------------------------------------------------------------------
runs-on: windows-2022
env:
QT_DIR: ${{ github.workspace }}\Remini\Qt\6.5.0\msvc2019_64
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Download catch.hpp and setup Environment Variable
shell: pwsh
run: |
New-Item -ItemType Directory -Force -Path catch2 | Out-Null
Invoke-WebRequest `
-Uri "https://github.com/catchorg/Catch2/releases/download/v2.13.10/catch.hpp" `
-OutFile catch2/catch.hpp
echo "CATCH_INCLUDE_DIR=$env:GITHUB_WORKSPACE" >> $env:GITHUB_ENV
cd ..
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
aqtversion: '==3.1.*'
version: '6.5.0'
host: 'windows'
target: 'desktop'
arch: 'win64_msvc2019_64'
dir: '${{ github.workspace }}\Remini'
cache: 'true'
cache-key-prefix: 'install-qt-action'
setup-python: 'false'
tools: 'tools_cmake'
- name: Configure CMake
shell: pwsh
run: |
cmake -S . -B Build -DCMAKE_BUILD_TYPE=Release -DQt6_DIR="$env:QT_DIR"
- name: Build the Qt project with CMake
run: cmake --build Build --config Release
- name: Deploy main executable
shell: pwsh
run: |
& "$env:QT_DIR\bin\windeployqt.exe" `
--no-translations `
"Build\Release\Remini.exe"
# ---------------------------------------------------------------------
# Test target name is `CatchTests` (defined in CatchTests/CMakeLists.txt
# via `project(CatchTests)` + `add_executable(${PROJECT_NAME} ...)`),
# NOT `ReminiTests`. `Remini` is the main application target.
#
# On the MSVC generator the binaries land in
# Build/<target>/Release/<target>.exe
# hence the `Build\CatchTests\Release` working directory below.
# ---------------------------------------------------------------------
- name: Run tests
shell: pwsh
working-directory: ${{ github.workspace }}\Build\CatchTests\Release
run: |
Write-Host "Contents:"
Get-ChildItem
& "$env:QT_DIR\bin\windeployqt.exe" --no-translations CatchTests.exe
.\CatchTests.exe