xref: /curl/.github/workflows/windows.yml (revision 8b368fa3)
1# Copyright (C) Viktor Szakats
2#
3# SPDX-License-Identifier: curl
4
5name: windows
6
7on:
8  push:
9    branches:
10      - master
11      - '*/ci'
12    paths-ignore:
13      - '**/*.md'
14      - '.azure-pipelines.yml'
15      - '.circleci/**'
16      - '.cirrus.yml'
17      - 'appveyor.*'
18      - 'packages/**'
19      - 'plan9/**'
20      - 'projects/**'
21      - 'winbuild/**'
22  pull_request:
23    branches:
24      - master
25    paths-ignore:
26      - '**/*.md'
27      - '.azure-pipelines.yml'
28      - '.circleci/**'
29      - '.cirrus.yml'
30      - 'appveyor.*'
31      - 'packages/**'
32      - 'plan9/**'
33      - 'projects/**'
34      - 'winbuild/**'
35
36concurrency:
37  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
38  cancel-in-progress: true
39
40permissions: {}
41
42jobs:
43  cygwin:
44    name: 'cygwin (${{ matrix.build }}, ${{ matrix.platform }}, ${{ matrix.config }})'
45    runs-on: windows-latest
46    timeout-minutes: 45
47    env:
48      SHELLOPTS: 'igncr'
49    strategy:
50      matrix:
51        include:
52          - { build: 'automake', platform: 'x86_64', tflags: ''       , config: '--enable-debug --disable-threaded-resolver' }
53          - { build: 'cmake'   , platform: 'x86_64', tflags: 'skipall', config: '-DCURL_USE_OPENSSL=ON' }
54      fail-fast: false
55    steps:
56      - run: git config --global core.autocrlf input
57      - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
58      - uses: cygwin/cygwin-install-action@006ad0b0946ca6d0a3ea2d4437677fa767392401 # v4
59        with:
60          platform: ${{ matrix.platform }}
61          # https://cygwin.com/cgi-bin2/package-grep.cgi
62          packages: autoconf libtool ${{ matrix.build }} gcc-core gcc-g++ binutils make libssl-devel zlib-devel libbrotli-devel libnghttp2-devel libpsl-devel libssh2-devel
63          site: https://mirrors.kernel.org/sourceware/cygwin/
64
65      - name: 'autotools configure'
66        if: ${{ matrix.build == 'automake' }}
67        timeout-minutes: 5
68        shell: C:\cygwin\bin\bash.exe '{0}'
69        run: |
70          export PATH="/usr/bin:$(cygpath "${SYSTEMROOT}")/System32"
71          autoreconf -fi
72          mkdir bld && cd bld && ../configure --enable-warnings --enable-werror \
73            --prefix="${HOME}"/install \
74            --enable-websockets \
75            --with-openssl \
76            --with-libssh2 \
77            --disable-dependency-tracking \
78            ${{ matrix.config }} || { tail -n 1200 config.log; false; }
79
80      - name: 'autotools build'
81        if: ${{ matrix.build == 'automake' }}
82        timeout-minutes: 10
83        shell: C:\cygwin\bin\bash.exe '{0}'
84        run: |
85          make -C bld -j5 V=1 install
86          find . -name '*.exe' -o -name '*.dll'
87          bld/src/curl.exe --disable --version
88
89      - name: 'autotools build examples'
90        if: ${{ matrix.build == 'automake' }}
91        timeout-minutes: 5
92        shell: C:\cygwin\bin\bash.exe '{0}'
93        run: |
94          make -C bld -j5 V=1 examples
95
96      - name: 'autotools build tests'
97        if: ${{ matrix.build == 'automake' && matrix.tflags != 'skipall' }}
98        timeout-minutes: 15
99        shell: C:\cygwin\bin\bash.exe '{0}'
100        run: |
101          make -C bld -j5 -C tests V=1
102
103      - name: 'autotools run tests'
104        if: ${{ matrix.build == 'automake' && matrix.tflags != 'skipall' && matrix.tflags != 'skiprun' }}
105        timeout-minutes: 40
106        shell: C:\cygwin\bin\bash.exe '{0}'
107        run: |
108          export TFLAGS='-j8 ${{ matrix.tflags }}'
109          if [ -x "$(cygpath "${SYSTEMROOT}/System32/curl.exe")" ]; then
110            TFLAGS+=" -ac $(cygpath "${SYSTEMROOT}/System32/curl.exe")"
111          fi
112          make -C bld -j5 V=1 test-ci
113
114      - name: 'cmake configure'
115        if: ${{ matrix.build == 'cmake' }}
116        timeout-minutes: 5
117        shell: C:\cygwin\bin\bash.exe '{0}'
118        run: |
119          export PATH="/usr/bin:$(cygpath "${SYSTEMROOT}")/System32"
120          cmake -B bld ${options} \
121            "-DCMAKE_C_FLAGS=${cflags}" \
122            -DCMAKE_UNITY_BUILD=ON \
123            -DCURL_WERROR=ON \
124            -DBUILD_EXAMPLES=ON \
125            -DENABLE_WEBSOCKETS=ON \
126            -DCURL_BROTLI=ON -DUSE_NGHTTP2=ON \
127            ${{ matrix.config }} || { cat bld/CMakeFiles/CMake*.yaml; false; }
128
129      - name: 'cmake build'
130        if: ${{ matrix.build == 'cmake' }}
131        timeout-minutes: 10
132        shell: C:\cygwin\bin\bash.exe '{0}'
133        run: |
134          cmake --build bld --config '${{ matrix.type }}' --parallel 5
135          [[ '${{ matrix.config }}' != *'BUILD_SHARED_LIBS=OFF'* ]] && cp -f -p bld/lib/*.dll bld/src/
136          find . -name '*.exe' -o -name '*.dll'
137          bld/src/curl.exe --disable --version
138
139      - name: 'cmake build tests'
140        if: ${{ matrix.build == 'cmake' && matrix.tflags != 'skipall' }}
141        timeout-minutes: 15
142        shell: C:\cygwin\bin\bash.exe '{0}'
143        run: |
144          cmake --build bld --config '${{ matrix.type }}' --parallel 5 --target testdeps
145
146      - name: 'cmake run tests'
147        if: ${{ matrix.build == 'cmake' && matrix.tflags != 'skipall' && matrix.tflags != 'skiprun' }}
148        timeout-minutes: 40
149        shell: C:\cygwin\bin\bash.exe '{0}'
150        run: |
151          export TFLAGS='-j8 ${{ matrix.tflags }}'
152          if [ -x "$(cygpath "${SYSTEMROOT}/System32/curl.exe")" ]; then
153            TFLAGS+=" -ac $(cygpath "${SYSTEMROOT}/System32/curl.exe")"
154          fi
155          ls bld/lib/*.dll >/dev/null 2>&1 && cp -f -p bld/lib/*.dll bld/tests/libtest/
156          cmake --build bld --config '${{ matrix.type }}' --target test-ci
157
158  msys2:
159    name: 'msys2 (${{ matrix.build }}, ${{ matrix.sys }}, ${{ matrix.env }}, ${{ matrix.config }}, ${{ matrix.test }})'
160    runs-on: windows-latest
161    timeout-minutes: 45
162    strategy:
163      matrix:
164        include:
165          - { build: 'autotools', sys: 'msys'   , env: 'x86_64'      , tflags: '!19                !1233', config: '--enable-debug --disable-threaded-resolver --disable-proxy' }
166          - { build: 'autotools', sys: 'msys'   , env: 'x86_64'      , tflags: '!19 !504 !704 !705 !1233', config: '--enable-debug --disable-threaded-resolver' }
167          - { build: 'cmake'    , sys: 'msys'   , env: 'x86_64'      , tflags: 'skipall'                 , config: '-DENABLE_DEBUG=ON -DENABLE_THREADED_RESOLVER=OFF' }
168          - { build: 'autotools', sys: 'msys'   , env: 'x86_64'      , tflags: '!19 !504 !704 !705 !1233', config: '' }
169          - { build: 'autotools', sys: 'mingw64', env: 'x86_64'      , tflags: 'skiprun'                 , config: '--enable-debug --disable-threaded-resolver --disable-curldebug --enable-static=no' }
170          # FIXME: WebSockets test results ignored due to frequent failures on native Windows:
171          - { build: 'cmake'    , sys: 'mingw64', env: 'x86_64'      , tflags: '~2301 ~2302'             , config: '-DENABLE_DEBUG=ON -DBUILD_SHARED_LIBS=OFF -DCURL_USE_SCHANNEL=ON -DENABLE_UNICODE=ON', type: 'Debug' }
172          - { build: 'cmake'    , sys: 'ucrt64' , env: 'ucrt-x86_64' , tflags: 'skiprun'                 , config: '-DENABLE_DEBUG=OFF -DBUILD_SHARED_LIBS=ON -DCURL_USE_SCHANNEL=ON -DENABLE_UNICODE=ON -DENABLE_CURLDEBUG=ON', type: 'Release' }
173          - { build: 'cmake'    , sys: 'clang64', env: 'clang-x86_64', tflags: 'skiprun'                 , config: '-DENABLE_DEBUG=ON -DBUILD_SHARED_LIBS=OFF -DCURL_USE_OPENSSL=ON -DENABLE_UNICODE=OFF', type: 'Release' }
174          - { build: 'cmake'    , sys: 'mingw64', env: 'x86_64'      , tflags: 'skiprun'                 , config: '-DENABLE_DEBUG=OFF -DBUILD_SHARED_LIBS=ON -DCURL_USE_SCHANNEL=ON -DENABLE_UNICODE=ON -DBUILD_EXAMPLES=OFF', type: 'Release', test: 'uwp' }
175      fail-fast: false
176    steps:
177      - run: git config --global core.autocrlf input
178      - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
179      - uses: msys2/setup-msys2@d0e80f58dffbc64f6a3a1f43527d469b4fc7b6c8 # v2
180        if: ${{ matrix.sys == 'msys' }}
181        with:
182          msystem: ${{ matrix.sys }}
183          # https://packages.msys2.org/search
184          install: gcc ${{ matrix.build }} make openssl-devel zlib-devel brotli-devel libnghttp2-devel libpsl-devel libssh2-devel
185      - uses: msys2/setup-msys2@d0e80f58dffbc64f6a3a1f43527d469b4fc7b6c8 # v2
186        if: ${{ matrix.sys != 'msys' }}
187        with:
188          msystem: ${{ matrix.sys }}
189          install: >-
190            mingw-w64-${{ matrix.env }}-cc
191            mingw-w64-${{ matrix.env }}-${{ matrix.build }} make
192            mingw-w64-${{ matrix.env }}-openssl
193            mingw-w64-${{ matrix.env }}-libssh2
194
195      - name: 'autotools configure'
196        if: ${{ matrix.build == 'autotools' }}
197        timeout-minutes: 5
198        shell: msys2 {0}
199        run: |
200          autoreconf -fi
201          mkdir bld && cd bld && ../configure --enable-warnings --enable-werror \
202            --prefix="${HOME}"/install \
203            --enable-websockets \
204            --with-openssl \
205            --with-libssh2 \
206            --disable-dependency-tracking \
207            ${{ matrix.config }} || { tail -n 1200 config.log; false; }
208
209      - name: 'autotools build'
210        if: ${{ matrix.build == 'autotools' }}
211        timeout-minutes: 10
212        shell: msys2 {0}
213        run: |
214          make -C bld -j5 V=1 install
215          find . -name '*.exe' -o -name '*.dll'
216          bld/src/curl.exe --disable --version
217
218      - name: 'autotools build examples'
219        if: ${{ matrix.build == 'autotools' }}
220        timeout-minutes: 5
221        shell: msys2 {0}
222        run: |
223          make -C bld -j5 V=1 examples
224
225      - name: 'autotools build tests'
226        if: ${{ matrix.build == 'autotools' && matrix.tflags != 'skipall' }}
227        timeout-minutes: 10
228        shell: msys2 {0}
229        run: |
230          make -C bld -j5 -C tests V=1
231
232      - name: 'autotools run tests'
233        if: ${{ matrix.build == 'autotools' && matrix.tflags != 'skipall' && matrix.tflags != 'skiprun' }}
234        timeout-minutes: 30
235        shell: msys2 {0}
236        run: |
237          export TFLAGS='-j14 !TFTP !MQTT !WebSockets ${{ matrix.tflags }}'
238          if [ -x "$(cygpath "${SYSTEMROOT}/System32/curl.exe")" ]; then
239            TFLAGS+=" -ac $(cygpath "${SYSTEMROOT}/System32/curl.exe")"
240          fi
241          make -C bld -j5 V=1 test-ci
242
243      - name: 'cmake configure'
244        if: ${{ matrix.build == 'cmake' }}
245        timeout-minutes: 5
246        shell: msys2 {0}
247        run: |
248          if [[ '${{ matrix.env }}' = 'clang'* ]]; then
249            options='-DCMAKE_C_COMPILER=clang'
250          else
251            options='-DCMAKE_C_COMPILER=gcc'
252          fi
253          cflags='-Wno-deprecated-declarations'  # for examples
254          if [ '${{ matrix.test }}' = 'uwp' ]; then
255            options+=' -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0'
256            pacman --noconfirm --ask 20 --noprogressbar --sync --needed 'mingw-w64-${{ matrix.env }}-winstorecompat-git'
257            specs="$(realpath gcc-specs-uwp)"
258            gcc -dumpspecs | sed -e 's/-lmingwex/-lwindowsapp -lmingwex -lwindowsapp -lwindowsappcompat/' -e 's/-lmsvcrt/-lmsvcr120_app/' > "${specs}"
259            cflags+=" -specs=$(cygpath -w "${specs}") -DWINSTORECOMPAT -DWINAPI_FAMILY=WINAPI_FAMILY_APP"
260            # CMake (as of v3.26.4) gets confused and applies the MSVC rc.exe command-line
261            # template to windres. Reset it to the windres template manually:
262            rcopts='<CMAKE_RC_COMPILER> -O coff <DEFINES> <INCLUDES> <FLAGS> <SOURCE> <OBJECT>'
263          else
264            rcopts=''
265          fi
266          [ '${{ matrix.type }}' = 'Debug' ] && options+=' -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG='
267          [ '${{ matrix.type }}' = 'Release' ] && options+=' -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE='
268          cmake -B bld ${options} \
269            "-DCMAKE_C_FLAGS=${cflags}" \
270            "-DCMAKE_RC_COMPILE_OBJECT=${rcopts}" \
271            '-DCMAKE_BUILD_TYPE=${{ matrix.type }}' \
272            -DCMAKE_UNITY_BUILD=ON \
273            -DCURL_WERROR=ON \
274            -DBUILD_EXAMPLES=ON \
275            -DENABLE_WEBSOCKETS=ON \
276            -DCURL_BROTLI=ON -DUSE_NGHTTP2=ON \
277            ${{ matrix.config }} || { cat bld/CMakeFiles/CMake*.yaml; false; }
278
279      - name: 'cmake build'
280        if: ${{ matrix.build == 'cmake' }}
281        timeout-minutes: 10
282        shell: msys2 {0}
283        run: |
284          cmake --build bld --config '${{ matrix.type }}' --parallel 5
285          [[ '${{ matrix.config }}' != *'BUILD_SHARED_LIBS=OFF'* ]] && cp -f -p bld/lib/*.dll bld/src/
286          find . -name '*.exe' -o -name '*.dll'
287          if [ '${{ matrix.test }}' != 'uwp' ]; then  # UWP missing 'msvcr120_app.dll', fails with exit code 0xc0000135
288            bld/src/curl.exe --disable --version
289          fi
290
291      - name: 'cmake build tests'
292        if: ${{ matrix.build == 'cmake' && matrix.tflags != 'skipall' }}
293        timeout-minutes: 10
294        shell: msys2 {0}
295        run: |
296          cmake --build bld --config '${{ matrix.type }}' --parallel 5 --target testdeps
297
298      - name: 'cmake run tests'
299        if: ${{ matrix.build == 'cmake' && matrix.tflags != 'skipall' && matrix.tflags != 'skiprun' }}
300        timeout-minutes: 40
301        shell: msys2 {0}
302        run: |
303          export TFLAGS='-j14 !TFTP !MQTT !WebSockets ${{ matrix.tflags }}'
304          if [ -x "$(cygpath "${SYSTEMROOT}/System32/curl.exe")" ]; then
305            TFLAGS+=" -ac $(cygpath "${SYSTEMROOT}/System32/curl.exe")"
306          fi
307          ls bld/lib/*.dll >/dev/null 2>&1 && cp -f -p bld/lib/*.dll bld/tests/libtest/
308          cmake --build bld --config '${{ matrix.type }}' --target test-ci
309
310  old-mingw-w64:
311    name: 'old-mingw-w64 (${{ matrix.build }}, ${{ matrix.env }}, ${{ matrix.config }})'
312    runs-on: windows-latest
313    timeout-minutes: 45
314    strategy:
315      matrix:
316        include:
317          - build: 'cmake'
318            env: '9.5.0-x86_64'
319            dir: 'mingw64'
320            url: 'https://github.com/brechtsanders/winlibs_mingw/releases/download/9.5.0-10.0.0-msvcrt-r1/winlibs-x86_64-posix-seh-gcc-9.5.0-mingw-w64msvcrt-10.0.0-r1.7z'
321            config: '-DENABLE_DEBUG=ON -DBUILD_SHARED_LIBS=OFF -DCURL_USE_SCHANNEL=ON -DENABLE_UNICODE=OFF'
322            type: 'Release'
323            tflags: '~2301 ~2302 ~3027'
324          - build: 'cmake'
325            env: '7.3.0-x86_64'
326            dir: 'mingw64'
327            url: 'https://downloads.sourceforge.net/mingw-w64/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/7.3.0/threads-win32/seh/x86_64-7.3.0-release-win32-seh-rt_v5-rev0.7z'
328            config: '-DENABLE_DEBUG=ON -DBUILD_SHARED_LIBS=OFF -DCURL_USE_SCHANNEL=ON -DENABLE_UNICODE=ON'
329            type: 'Debug'
330            tflags: '~2301 ~2302 ~3027'
331          - build: 'cmake'
332            env: '6.4.0-i686'
333            dir: 'mingw32'
334            url: 'https://downloads.sourceforge.net/mingw-w64/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/6.4.0/threads-win32/dwarf/i686-6.4.0-release-win32-dwarf-rt_v5-rev0.7z'
335            config: '-DENABLE_DEBUG=ON -DBUILD_SHARED_LIBS=OFF -DCURL_USE_SCHANNEL=ON -DENABLE_UNICODE=OFF -DCMAKE_UNITY_BUILD=OFF'
336            type: 'Debug'
337            tflags: 'skiprun'
338      fail-fast: false
339    steps:
340      - name: 'cache compiler (gcc ${{ matrix.env }})'
341        uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4
342        id: cache-compiler
343        with:
344          path: ~\my-cache
345          key: ${{ runner.os }}-mingw-w64-${{ matrix.env }}
346
347      - name: 'install compiler (gcc ${{ matrix.env }})'
348        if: ${{ steps.cache-compiler.outputs.cache-hit != 'true' }}
349        timeout-minutes: 5
350        shell: C:\msys64\usr\bin\bash.exe {0}
351        run: |
352          cd "${USERPROFILE}" || exit 1
353          mkdir my-cache
354          cd my-cache || exit 1
355          curl --fail --silent --show-error --retry 3 --retry-connrefused --output pack.bin --location --proto-redir =https '${{ matrix.url }}'
356          pwd
357          7z x -y pack.bin >/dev/null
358          rm -r -f pack.bin
359          ls -l
360
361      - run: git config --global core.autocrlf input
362      - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
363
364      - name: 'cmake configure'
365        if: ${{ matrix.build == 'cmake' }}
366        timeout-minutes: 5
367        shell: C:\msys64\usr\bin\bash.exe {0}
368        run: |
369          export PATH="$(cygpath "${USERPROFILE}")/my-cache/${{ matrix.dir }}/bin:/c/msys64/usr/bin:$PATH"
370          cflags='-Wno-deprecated-declarations'  # for examples
371          [ '${{ matrix.type }}' = 'Debug' ] && options+=' -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG='
372          [ '${{ matrix.type }}' = 'Release' ] && options+=' -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE='
373          cmake -B bld ${options} \
374            '-GMSYS Makefiles' \
375            -DCMAKE_C_COMPILER=gcc \
376            "-DCMAKE_C_FLAGS=${cflags}" \
377            '-DCMAKE_BUILD_TYPE=${{ matrix.type }}' \
378            -DCMAKE_UNITY_BUILD=ON \
379            -DCURL_WERROR=ON \
380            -DBUILD_EXAMPLES=ON \
381            -DENABLE_WEBSOCKETS=ON \
382            ${{ matrix.config }} || { cat bld/CMakeFiles/CMake*.yaml; false; }
383
384      - name: 'cmake build'
385        if: ${{ matrix.build == 'cmake' }}
386        timeout-minutes: 10
387        shell: C:\msys64\usr\bin\bash.exe {0}
388        run: |
389          export PATH="$(cygpath "${USERPROFILE}")/my-cache/${{ matrix.dir }}/bin:/c/msys64/usr/bin:$PATH"
390          cmake --build bld --config '${{ matrix.type }}' --parallel 5
391          [[ '${{ matrix.config }}' != *'BUILD_SHARED_LIBS=OFF'* ]] && cp -f -p bld/lib/*.dll bld/src/
392          bld/src/curl.exe --disable --version
393
394      - name: 'cmake build tests'
395        if: ${{ matrix.build == 'cmake' && matrix.tflags != 'skipall' }}
396        timeout-minutes: 10
397        shell: C:\msys64\usr\bin\bash.exe {0}
398        run: |
399          export PATH="$(cygpath "${USERPROFILE}")/my-cache/${{ matrix.dir }}/bin:/c/msys64/usr/bin:$PATH"
400          cmake --build bld --config '${{ matrix.type }}' --parallel 5 --target testdeps
401
402      - name: 'cmake run tests'
403        if: ${{ matrix.build == 'cmake' && matrix.tflags != 'skipall' && matrix.tflags != 'skiprun' }}
404        timeout-minutes: 40
405        shell: C:\msys64\usr\bin\bash.exe {0}
406        run: |
407          export PATH="$(cygpath "${USERPROFILE}")/my-cache/${{ matrix.dir }}/bin:/c/msys64/usr/bin:$PATH"
408          export TFLAGS='-j14 !TFTP !MQTT !WebSockets ${{ matrix.tflags }}'
409          if [ -x "$(cygpath "${SYSTEMROOT}/System32/curl.exe")" ]; then
410            TFLAGS+=" -ac $(cygpath "${SYSTEMROOT}/System32/curl.exe")"
411          fi
412          ls bld/lib/*.dll >/dev/null 2>&1 && cp -f -p bld/lib/*.dll bld/tests/libtest/
413          cmake --build bld --config '${{ matrix.type }}' --target test-ci
414
415  msvc:
416    name: 'msvc (${{ matrix.arch }}, ${{ matrix.plat }}, ${{ matrix.config }})'
417    runs-on: windows-latest
418    timeout-minutes: 30
419    strategy:
420      matrix:
421        include:
422          - { arch: 'x64', plat: 'windows', tflags: '~1516 ~2301 ~2302 ~2303 ~2307', config: '-DENABLE_DEBUG=ON -DCURL_USE_SCHANNEL=ON  -DBUILD_SHARED_LIBS=OFF -DENABLE_UNICODE=ON ', type: 'Debug' }
423          - { arch: 'x64', plat: 'windows', tflags: '~1516 ~2301 ~2302 ~2303 ~2307', config: '-DENABLE_DEBUG=ON -DCURL_USE_SCHANNEL=OFF -DBUILD_SHARED_LIBS=OFF -DENABLE_UNICODE=OFF', type: 'Debug' }
424          - { arch: 'x64', plat: 'windows', tflags: '~1516 ~2301 ~2302 ~2303 ~2307', config: '-DENABLE_DEBUG=ON -DCURL_USE_SCHANNEL=OFF -DHTTP_ONLY=ON          -DENABLE_UNICODE=OFF', type: 'Debug' }
425      fail-fast: false
426    steps:
427      - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
428      - name: 'cmake configure'
429        timeout-minutes: 5
430        shell: bash
431        run: |
432          archgen=${{ matrix.arch }}; [ "${archgen}" = 'x86' ] && archgen='Win32'
433          if [ '${{ matrix.plat }}' = 'uwp' ]; then
434            system='WindowsStore'
435            options='-DCMAKE_SYSTEM_VERSION=10.0'
436          else
437            system='Windows'
438          fi
439          [ '${{ matrix.type }}' = 'Debug' ] && options+=' -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG='
440          [ '${{ matrix.type }}' = 'Release' ] && options+=' -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE='
441          cmake -B bld ${options} \
442            "-DCMAKE_SYSTEM_NAME=${system}" \
443            -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake \
444            "-DCMAKE_GENERATOR_PLATFORM=${archgen}" \
445            '-DVCPKG_TARGET_TRIPLET=${{ matrix.arch }}-${{ matrix.plat }}' \
446            -DCMAKE_VS_GLOBALS=TrackFileAccess=false \
447            '-DCMAKE_UNITY_BUILD=${{ matrix.unity }}' \
448            "-DCMAKE_C_FLAGS=${cflags}" \
449            '-DCMAKE_BUILD_TYPE=${{ matrix.type }}' \
450            -DCMAKE_UNITY_BUILD=ON \
451            -DCURL_WERROR=ON \
452            -DBUILD_EXAMPLES=ON \
453            -DENABLE_WEBSOCKETS=ON \
454            ${{ matrix.config }} || { cat bld/CMakeFiles/CMake*.yaml; false; }
455
456      - name: 'cmake build'
457        timeout-minutes: 5
458        shell: bash
459        run: |
460          cmake --build bld --config '${{ matrix.type }}' --parallel 5
461          [[ '${{ matrix.config }}' != *'BUILD_SHARED_LIBS=OFF'* ]] && cp -f -p bld/lib/*.dll bld/src/
462          bld/src/curl.exe --disable --version
463
464      - name: 'cmake build tests'
465        if: ${{ matrix.tflags != 'skipall' }}
466        timeout-minutes: 10
467        shell: bash
468        run: |
469          cmake --build bld --config '${{ matrix.type }}' --parallel 5 --target testdeps
470
471      - name: 'cmake run tests'
472        if: ${{ matrix.tflags != 'skipall' && matrix.tflags != 'skiprun' }}
473        timeout-minutes: 30
474        shell: bash
475        run: |
476          export TFLAGS='-j14 !TFTP !MQTT !WebSockets ${{ matrix.tflags }}'
477          ls bld/lib/*.dll >/dev/null 2>&1 && cp -f -p bld/lib/*.dll bld/tests/libtest/
478          cmake --build bld --config '${{ matrix.type }}' --target test-ci
479