-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
280 lines (258 loc) · 11 KB
/
windows.yml
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
# Copyright (C) Viktor Szakats
#
# SPDX-License-Identifier: curl
name: windows
on:
push:
branches:
- master
- '*/ci'
paths-ignore:
- '**/*.md'
- '.azure-pipelines.yml'
- '.circleci/**'
- '.cirrus.yml'
- 'appveyor.*'
- 'packages/**'
- 'plan9/**'
- 'projects/**'
- 'winbuild/**'
pull_request:
branches:
- master
paths-ignore:
- '**/*.md'
- '.azure-pipelines.yml'
- '.circleci/**'
- '.cirrus.yml'
- 'appveyor.*'
- 'packages/**'
- 'plan9/**'
- 'projects/**'
- 'winbuild/**'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
permissions: {}
jobs:
cygwin:
name: "cygwin (${{ matrix.build }}, ${{ matrix.platform }}, ${{ matrix.config }})"
runs-on: windows-latest
timeout-minutes: 45
env:
SHELLOPTS: 'igncr'
strategy:
matrix:
include:
- { build: 'automake', platform: 'x86_64', tflags: '', config: '--enable-debug --disable-threaded-resolver' }
- { build: 'cmake' , platform: 'x86_64', tflags: '', config: '-DCURL_USE_OPENSSL=ON' }
fail-fast: false
steps:
- run: git config --global core.autocrlf input
- uses: actions/checkout@v4
- uses: cygwin/cygwin-install-action@v4
with:
platform: ${{ matrix.platform }}
# https://cygwin.com/cgi-bin2/package-grep.cgi
packages: autoconf libtool ${{ matrix.build }} gcc-core gcc-g++ binutils make libssl-devel zlib-devel libbrotli-devel libnghttp2-devel libpsl-devel libssh2-devel
site: https://mirrors.kernel.org/sourceware/cygwin/
- name: 'autotools configure'
if: ${{ matrix.build == 'automake' }}
timeout-minutes: 5
shell: C:\cygwin\bin\bash.exe '{0}'
run: |
export PATH="/usr/bin:$(cygpath ${SYSTEMROOT})/system32"
autoreconf -fi
mkdir bld && cd bld && ../configure --enable-warnings --enable-werror \
--prefix="${HOME}"/install \
--enable-websockets \
--with-openssl \
--with-libssh2 \
${{ matrix.config }} || { tail -n 1200 config.log; false; }
- name: 'autotools build'
if: ${{ matrix.build == 'automake' }}
timeout-minutes: 10
shell: C:\cygwin\bin\bash.exe '{0}'
run: |
make -C bld -j3 V=1 install
find . -name '*.exe' -o -name '*.dll'
bld/src/curl.exe --disable --version
- name: 'autotools build examples'
if: ${{ matrix.build == 'automake' }}
timeout-minutes: 5
shell: C:\cygwin\bin\bash.exe '{0}'
run: |
make -C bld -j3 V=1 examples
- name: 'autotools build tests'
if: ${{ matrix.build == 'automake' }}
timeout-minutes: 10
shell: C:\cygwin\bin\bash.exe '{0}'
run: |
make -C bld -j3 -C tests V=1
- name: 'autotools run tests'
if: ${{ matrix.build == 'automake' && matrix.tflags != 'skip' }}
timeout-minutes: 40
shell: C:\cygwin\bin\bash.exe '{0}'
run: |
export TFLAGS='-j8 ${{ matrix.tflags }}'
if [ -x "$(cygpath -u "${SYSTEMROOT}/System32/curl.exe")" ]; then
TFLAGS+=" -ac $(cygpath -u "${SYSTEMROOT}/System32/curl.exe")"
fi
make -C bld -j3 V=1 test-ci
- name: 'cmake configure'
if: ${{ matrix.build == 'cmake' }}
timeout-minutes: 5
shell: C:\cygwin\bin\bash.exe '{0}'
run: |
export PATH="/usr/bin:$(cygpath ${SYSTEMROOT})/system32"
cmake -B bld ${options} ${{ matrix.config }} \
"-DCMAKE_C_FLAGS=${cflags}" \
-DCMAKE_UNITY_BUILD=ON \
-DCURL_WERROR=ON \
-DBUILD_EXAMPLES=ON \
-DENABLE_WEBSOCKETS=ON \
-DCURL_BROTLI=ON -DUSE_NGHTTP2=ON
- name: 'cmake build'
if: ${{ matrix.build == 'cmake' }}
timeout-minutes: 10
shell: C:\cygwin\bin\bash.exe '{0}'
run: |
cmake --build bld --config '${{ matrix.type }}' --parallel 3
[[ '${{ matrix.config }}' != *'BUILD_SHARED_LIBS=OFF'* ]] && cp -f -p bld/lib/*.dll bld/src/
find . -name '*.exe' -o -name '*.dll'
bld/src/curl.exe --disable --version
msys2:
name: "msys2 (${{ matrix.build }}, ${{ matrix.sys }}, ${{ matrix.env }}, ${{ matrix.config }})"
runs-on: windows-latest
timeout-minutes: 45
strategy:
matrix:
include:
- { build: 'autotools', sys: 'msys' , env: 'x86_64' , tflags: '!19 !1233' , config: '--enable-debug --disable-threaded-resolver --disable-proxy' }
- { build: 'autotools', sys: 'msys' , env: 'x86_64' , tflags: '!19 !504 !704 !705 !1233' , config: '--enable-debug --disable-threaded-resolver' }
- { build: 'autotools', sys: 'msys' , env: 'x86_64' , tflags: '!19 !504 !704 !705 !1233' , config: '' }
# FIXME: WebSockets test results ignored due to frequent failures on native Windows:
- { build: 'cmake' , sys: 'mingw64', env: 'x86_64' , tflags: '!19 !504 !704 !705 !1233 ~2301 ~2305', config: '-DENABLE_DEBUG=ON -DBUILD_SHARED_LIBS=OFF -DCURL_USE_SCHANNEL=ON -DENABLE_UNICODE=ON', type: 'Debug' }
- { build: 'cmake' , sys: 'mingw64', env: 'x86_64' , tflags: 'skip' , config: '-DENABLE_DEBUG=ON -DBUILD_SHARED_LIBS=OFF -DCURL_USE_SCHANNEL=ON -DENABLE_UNICODE=ON', type: 'Release' }
- { build: 'cmake' , sys: 'clang64', env: 'clang-x86_64', tflags: 'skip' , config: '-DENABLE_DEBUG=ON -DBUILD_SHARED_LIBS=OFF -DCURL_USE_OPENSSL=ON -DENABLE_UNICODE=OFF', type: 'Release' }
fail-fast: false
steps:
- run: git config --global core.autocrlf input
- uses: actions/checkout@v4
- uses: msys2/setup-msys2@v2
if: ${{ matrix.sys == 'msys' }}
with:
msystem: ${{ matrix.sys }}
# https://packages.msys2.org/search
install: gcc ${{ matrix.build }} make openssl-devel zlib-devel brotli-devel libnghttp2-devel libpsl-devel libssh2-devel
- uses: msys2/setup-msys2@v2
if: ${{ matrix.sys != 'msys' }}
with:
msystem: ${{ matrix.sys }}
install: >-
mingw-w64-${{ matrix.env }}-cc
mingw-w64-${{ matrix.env }}-${{ matrix.build }} make
mingw-w64-${{ matrix.env }}-openssl
- name: 'autotools configure'
if: ${{ matrix.build == 'autotools' }}
timeout-minutes: 5
shell: msys2 {0}
run: |
autoreconf -fi
mkdir bld && cd bld && ../configure --enable-warnings --enable-werror \
--prefix="${HOME}"/install \
--enable-websockets \
--with-openssl \
--with-libssh2 \
${{ matrix.config }} || { tail -n 1200 config.log; false; }
- name: 'autotools build'
if: ${{ matrix.build == 'autotools' }}
timeout-minutes: 10
shell: msys2 {0}
run: |
make -C bld -j3 V=1 install
find . -name '*.exe' -o -name '*.dll'
bld/src/curl.exe --disable --version
- name: 'autotools build examples'
if: ${{ matrix.build == 'autotools' }}
timeout-minutes: 5
shell: msys2 {0}
run: |
make -C bld -j3 V=1 examples
- name: 'autotools build tests'
if: ${{ matrix.build == 'autotools' }}
timeout-minutes: 10
shell: msys2 {0}
run: |
make -C bld -j3 -C tests V=1
- name: 'autotools run tests'
if: ${{ matrix.build == 'autotools' && matrix.tflags != 'skip' }}
timeout-minutes: 30
shell: msys2 {0}
run: |
export TFLAGS='-j14 ${{ matrix.tflags }}'
if [ -x "$(cygpath -u 'C:/msys64/usr/bin/curl.exe')" ]; then
TFLAGS+=" -ac $(cygpath -u 'C:/msys64/usr/bin/curl.exe')"
fi
make -C bld -j3 V=1 test-ci
- name: 'cmake configure'
if: ${{ matrix.build == 'cmake' }}
timeout-minutes: 5
shell: msys2 {0}
run: |
if [[ '${{ matrix.env }}' = 'clang'* ]]; then
options='-DCMAKE_C_COMPILER=clang'
else
options='-DCMAKE_C_COMPILER=gcc'
fi
cflags='-Wno-deprecated-declarations'
if [ '${{ matrix.test }}' = 'uwp' ]; then
options+=' -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0'
pacman --noconfirm --ask 20 --noprogressbar --sync --needed 'mingw-w64-${{ matrix.env }}-winstorecompat-git'
specs="$(realpath gcc-specs-uwp)"
gcc -dumpspecs | sed -e 's/-lmingwex/-lwindowsapp -lmingwex -lwindowsapp -lwindowsappcompat/' -e 's/-lmsvcrt/-lmsvcr120_app/' > "${specs}"
cflags+=" -specs=${specs} -DWINSTORECOMPAT -DWINAPI_FAMILY=WINAPI_FAMILY_APP"
# CMake (as of v3.26.4) gets confused and applies the MSVC rc.exe command-line
# template to windres. Reset it to the windres template manually:
rcopts='<CMAKE_RC_COMPILER> -O coff <DEFINES> <INCLUDES> <FLAGS> <SOURCE> <OBJECT>'
else
rcopts=''
fi
[ '${{ matrix.type }}' = 'Debug' ] && options+=' -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG='
[ '${{ matrix.type }}' = 'Release' ] && options+=' -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE='
[ '${{ matrix.type }}' = 'Release' ] && [[ '${{ matrix.config }}' = *'ENABLE_DEBUG=ON'* ]] && cflags+=' -DDEBUGBUILD'
cmake -B bld ${options} ${{ matrix.config }} \
"-DCMAKE_C_FLAGS=${cflags}" \
"-DCMAKE_RC_COMPILE_OBJECT=${rcopts}" \
"-DCMAKE_BUILD_TYPE=${{ matrix.type }}" \
-DCMAKE_UNITY_BUILD=ON \
-DCURL_WERROR=ON \
-DBUILD_EXAMPLES=ON \
-DENABLE_WEBSOCKETS=ON \
-DCURL_BROTLI=ON -DUSE_NGHTTP2=ON
- name: 'cmake build'
if: ${{ matrix.build == 'cmake' }}
timeout-minutes: 10
shell: msys2 {0}
run: |
cmake --build bld --config '${{ matrix.type }}' --parallel 3
[[ '${{ matrix.config }}' != *'BUILD_SHARED_LIBS=OFF'* ]] && cp -f -p bld/lib/*.dll bld/src/
find . -name '*.exe' -o -name '*.dll'
bld/src/curl.exe --disable --version
- name: 'cmake build tests'
if: ${{ matrix.build == 'cmake' }}
timeout-minutes: 10
shell: msys2 {0}
run: |
cmake --build bld --config '${{ matrix.type }}' --parallel 3 --target testdeps
- name: 'cmake run tests'
if: ${{ matrix.build == 'cmake' && matrix.tflags != 'skip' }}
timeout-minutes: 40
shell: msys2 {0}
run: |
export TFLAGS='-j14 ${{ matrix.tflags }}'
if [ -x "$(cygpath -u 'C:/msys64/usr/bin/curl.exe')" ]; then
TFLAGS+=" -ac $(cygpath -u 'C:/msys64/usr/bin/curl.exe')"
fi
ls bld/lib/*.dll >/dev/null 2>&1 && cp -f -p bld/lib/*.dll bld/tests/libtest/
cmake --build bld --config '${{ matrix.type }}' --target test-ci