forked from uriparser/uriparser
-
Notifications
You must be signed in to change notification settings - Fork 0
130 lines (112 loc) · 3.88 KB
/
Copy pathwindows.yml
File metadata and controls
130 lines (112 loc) · 3.88 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# Copyright (C) 2025 Sebastian Pipping <sebastian@pipping.org>
# Licensed under the MIT license
name: Build and test (Windows)
on:
pull_request:
push:
schedule:
- cron: '0 2 * * 5' # Every Friday at 2am
workflow_dispatch:
permissions:
contents: read
jobs:
windows:
name: Build and test (Windows)
strategy:
fail-fast: false
matrix:
include:
# Visual Studio 2022, 32 bit
- runs-on: windows-2022
cmake_generator: Visual Studio 17 2022
common_cmake_args: -A Win32
googletest_version: 1.12.0
uriparser_sln: uriparser.sln
# Visual Studio 2022, 64 bit
- runs-on: windows-2022
cmake_generator: Visual Studio 17 2022
common_cmake_args: -A x64
googletest_version: 1.14.0 # matches Ubuntu 24.04
uriparser_sln: uriparser.sln
# Visual Studio 2026, 32 bit
- runs-on: windows-2025-vs2026
cmake_generator: Visual Studio 18 2026
common_cmake_args: -A Win32
googletest_version: 1.16.0 # matches Debian trixie
uriparser_sln: uriparser.slnx
# Visual Studio 2026, 64 bit
- runs-on: windows-2025-vs2026
cmake_generator: Visual Studio 18 2026
common_cmake_args: -A x64
googletest_version: 1.17.0 # latest upstream with C++17
uriparser_sln: uriparser.slnx
runs-on: ${{ matrix.runs-on }}
defaults:
run:
shell: bash
env:
CMAKE_GENERATOR: ${{ matrix.cmake_generator }}
COMMON_CMAKE_ARGS: ${{ matrix.common_cmake_args }}
GTEST_VERSION: ${{ matrix.googletest_version }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: microsoft/setup-msbuild@30375c66a4eea26614e0d39710365f22f8b0af57 # v3.0.0
- name: Build dependency googletest
run: |-
set -x
curl -fsSL -o "release-${GTEST_VERSION}.zip" "https://github.com/google/googletest/archive/refs/tags/v${GTEST_VERSION}.zip"
unzip -q "release-${GTEST_VERSION}.zip"
cd "googletest-${GTEST_VERSION}"
# Workaround compilation issues with GoogleTest 1.17.0
# - https://github.com/google/googletest/issues/4731
# - https://github.com/google/googletest/pull/4877
if [[ ${GTEST_VERSION} = 1.17.0 ]] ; then
curl -fsSL -o build.patch https://github.com/google/googletest/commit/0b656495436f57212be8700794a3d5fb14000c5f.patch
patch -p 1 < build.patch
fi
cmake \
-G "${CMAKE_GENERATOR}" \
-DCVF_VERSION="${GTEST_VERSION}" \
${COMMON_CMAKE_ARGS}
cmake --build . --config Release -- -m
# Enrich folder to make FindGTest.cmake happy
mkdir -p googletest/lib
cp -v lib/Release/{gtest,gtest_main}.lib googletest/lib/
- name: Configure
run: |-
cmake_args=(
-G "${CMAKE_GENERATOR}"
# NOTE: GTEST_ROOT is relative to source CMakeLists.txt, not the build directory
-DGTEST_ROOT="googletest-${GTEST_VERSION}/googletest"
-DURIPARSER_BUILD_DOCS=OFF
-DURIPARSER_BUILD_TESTS=ON
-DURIPARSER_MSVC_STATIC_CRT=ON
-DURIPARSER_WARNINGS_AS_ERRORS=ON
-S .
-B build/
${COMMON_CMAKE_ARGS}
)
set -x
cmake "${cmake_args[@]}"
- name: Build
env:
uriparser_sln: ${{ matrix.uriparser_sln }}
run: |-
msbuild_args=(
-m
-property:Configuration=Release
)
set -x
cd build
MSBuild.exe "${msbuild_args[@]}" "${uriparser_sln}"
- name: Run tests
run: |-
ctest_args=(
--build-config Release
--no-tests=error
--output-on-failure
--parallel 2
)
set -x
cd build
ctest "${ctest_args[@]}"