• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (C) Viktor Szakats
2#
3# SPDX-License-Identifier: curl
4
5name: non-native
6
7'on':
8  push:
9    branches:
10      - master
11      - '*/ci'
12    paths-ignore:
13      - '**/*.md'
14      - '.circleci/**'
15      - 'appveyor.*'
16      - 'packages/**'
17      - 'plan9/**'
18      - 'projects/**'
19      - 'winbuild/**'
20  pull_request:
21    branches:
22      - master
23    paths-ignore:
24      - '**/*.md'
25      - '.circleci/**'
26      - 'appveyor.*'
27      - 'packages/**'
28      - 'plan9/**'
29      - 'projects/**'
30      - 'winbuild/**'
31
32concurrency:
33  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
34  cancel-in-progress: true
35
36permissions: {}
37
38jobs:
39  netbsd:
40    name: 'NetBSD, CM clang openssl ${{ matrix.arch }}'
41    runs-on: ubuntu-latest
42    timeout-minutes: 10
43    strategy:
44      matrix:
45        arch: ['x86_64']
46    steps:
47      - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
48        with:
49          persist-credentials: false
50      - name: 'cmake'
51        uses: cross-platform-actions/action@fe0167d8082ac584754ef3ffb567fded22642c7d # v0.27.0
52        with:
53          operating_system: 'netbsd'
54          version: '10.1'
55          architecture: ${{ matrix.arch }}
56          run: |
57            # https://pkgsrc.se/
58            time sudo pkgin -y install cmake ninja-build pkg-config perl brotli heimdal openldap-client libssh2 libidn2 libpsl nghttp2 py311-impacket
59            time cmake -B bld -G Ninja \
60              -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \
61              -DCURL_WERROR=ON \
62              -DENABLE_DEBUG=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG= \
63              -DCURL_USE_OPENSSL=ON \
64              -DCURL_USE_GSSAPI=ON \
65              || { cat bld/CMakeFiles/CMake*.yaml; false; }
66            echo '::group::curl_config.h (raw)'; cat bld/lib/curl_config.h || true; echo '::endgroup::'
67            echo '::group::curl_config.h'; grep -F '#define' bld/lib/curl_config.h | sort || true; echo '::endgroup::'
68            time cmake --build bld --config Debug
69            bld/src/curl --disable --version
70            if [ '${{ matrix.arch }}' = 'x86_64' ]; then  # Slow on emulated CPU
71              time cmake --build bld --config Debug --target testdeps
72              export TFLAGS='-j4'
73              time cmake --build bld --config Debug --target test-ci
74            fi
75            echo '::group::build examples'
76            time cmake --build bld --config Debug --target curl-examples
77            echo '::endgroup::'
78
79  openbsd:
80    name: 'OpenBSD, CM clang libressl ${{ matrix.arch }}'
81    runs-on: ubuntu-latest
82    timeout-minutes: 10
83    strategy:
84      matrix:
85        arch: ['x86_64']
86    steps:
87      - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
88        with:
89          persist-credentials: false
90      - name: 'cmake'
91        uses: cross-platform-actions/action@fe0167d8082ac584754ef3ffb567fded22642c7d # v0.27.0
92        with:
93          operating_system: 'openbsd'
94          version: '7.5'
95          architecture: ${{ matrix.arch }}
96          run: |
97            # https://openbsd.app/
98            # https://www.openbsd.org/faq/faq15.html
99            time sudo pkg_add cmake ninja brotli openldap-client-- libssh2 libidn2 libpsl nghttp2 python3 py3-impacket
100            time cmake -B bld -G Ninja \
101              -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \
102              -DCURL_WERROR=ON \
103              -DENABLE_DEBUG=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG= \
104              -DCURL_USE_OPENSSL=ON \
105              || { cat bld/CMakeFiles/CMake*.yaml; false; }
106            echo '::group::curl_config.h (raw)'; cat bld/lib/curl_config.h || true; echo '::endgroup::'
107            echo '::group::curl_config.h'; grep -F '#define' bld/lib/curl_config.h | sort || true; echo '::endgroup::'
108            time cmake --build bld --config Debug
109            bld/src/curl --disable --version
110            if [ '${{ matrix.arch }}' = 'x86_64' ]; then  # Slow on emulated CPU
111              time cmake --build bld --config Debug --target testdeps
112              export TFLAGS='-j8 ~3017 ~TFTP ~FTP'  # FIXME: TFTP requests executed twice? Related: `curl: (69) TFTP: Access Violation`?
113              time cmake --build bld --config Debug --target test-ci
114            fi
115            echo '::group::build examples'
116            time cmake --build bld --config Debug --target curl-examples
117            echo '::endgroup::'
118
119  freebsd:
120    name: "FreeBSD, ${{ matrix.build == 'cmake' && 'CM' || 'AM' }} ${{ matrix.compiler }} openssl ${{ matrix.arch }}"
121    runs-on: ubuntu-latest
122    timeout-minutes: 20
123    strategy:
124      matrix:
125        include:
126          - { build: 'autotools', arch: 'x86_64', compiler: 'clang' }
127          - { build: 'autotools', arch: 'arm64', compiler: 'clang' }
128          - { build: 'cmake'    , arch: 'arm64', compiler: 'clang' }
129      fail-fast: false
130    steps:
131      - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
132        with:
133          persist-credentials: false
134      - name: 'autotools'
135        if: ${{ matrix.build == 'autotools' }}
136        uses: cross-platform-actions/action@fe0167d8082ac584754ef3ffb567fded22642c7d # v0.27.0
137        with:
138          operating_system: 'freebsd'
139          version: '14.1'
140          architecture: ${{ matrix.arch }}
141          run: |
142            # https://ports.freebsd.org/
143            time sudo pkg install -y autoconf automake libtool \
144              pkgconf brotli openldap26-client libidn2 libnghttp2 stunnel py311-impacket
145            time autoreconf -fi
146            export CC='${{ matrix.compiler }}'
147            mkdir bld && cd bld && time ../configure --enable-unity --enable-test-bundles --enable-debug --enable-warnings --enable-werror \
148              --prefix="${HOME}"/install \
149              --with-openssl \
150              --with-brotli --enable-ldap --enable-ldaps --with-libidn2 --with-libssh2 --with-nghttp2 --with-gssapi \
151              --disable-dependency-tracking || { tail -n 1000 config.log; false; }
152            echo '::group::curl_config.h (raw)'; cat lib/curl_config.h || true; echo '::endgroup::'
153            echo '::group::curl_config.h'; grep -F '#define' lib/curl_config.h | sort || true; echo '::endgroup::'
154            time make -j3 install
155            src/curl --disable --version
156            if [ '${{ matrix.arch }}' = 'x86_64' ]; then  # Slow on emulated CPU
157              time make -j3 -C tests
158              time make test-ci V=1 TFLAGS='-j4'
159            fi
160            echo '::group::build examples'
161            time make -j3 examples
162            echo '::endgroup::'
163
164      - name: 'cmake'
165        if: ${{ matrix.build == 'cmake' }}
166        uses: cross-platform-actions/action@fe0167d8082ac584754ef3ffb567fded22642c7d # v0.27.0
167        with:
168          operating_system: 'freebsd'
169          version: '14.1'
170          architecture: ${{ matrix.arch }}
171          run: |
172            # https://ports.freebsd.org/
173            time sudo pkg install -y cmake-core ninja perl5 \
174              pkgconf brotli openldap26-client libidn2 libnghttp2 stunnel py311-impacket
175            time cmake -B bld -G Ninja \
176              -DCMAKE_C_COMPILER='${{ matrix.compiler }}' \
177              -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \
178              -DCURL_WERROR=ON \
179              -DENABLE_DEBUG=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG= \
180              -DCURL_USE_OPENSSL=ON \
181              -DCURL_USE_GSSAPI=ON \
182              || { cat bld/CMakeFiles/CMake*.yaml; false; }
183            echo '::group::curl_config.h (raw)'; cat bld/lib/curl_config.h || true; echo '::endgroup::'
184            echo '::group::curl_config.h'; grep -F '#define' bld/lib/curl_config.h | sort || true; echo '::endgroup::'
185            time cmake --build bld --config Debug
186            bld/src/curl --disable --version
187            if [ '${{ matrix.arch }}' = 'x86_64' ]; then  # Slow on emulated CPU
188              time cmake --build bld --config Debug --target testdeps
189              time cmake --build bld --config Debug --target test-ci
190            fi
191            echo '::group::build examples'
192            time cmake --build bld --config Debug --target curl-examples
193            echo '::endgroup::'
194
195  omnios:
196    name: 'OmniOS, AM gcc openssl amd64'
197    runs-on: ubuntu-latest
198    timeout-minutes: 15
199    steps:
200      - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
201        with:
202          persist-credentials: false
203      - name: 'autotools'
204        uses: vmactions/omnios-vm@8eba2a9217262f275d4566751a92d6ef2f433d00 # v1
205        with:
206          usesh: true
207          # https://pkg.omnios.org/r151052/core/en/index.shtml
208          prepare: pkg install build-essential libtool nghttp2
209          run: |
210            set -e
211            ln -s /usr/bin/gcpp /usr/bin/cpp  # Some tests expect `cpp`, which is named `gcpp` in this env.
212            time autoreconf -fi
213            mkdir bld && cd bld && time ../configure --enable-unity --enable-test-bundles --enable-debug --enable-warnings --enable-werror \
214              --prefix="${HOME}"/install \
215              --with-openssl \
216              --disable-dependency-tracking || { tail -n 1000 config.log; false; }
217            echo '::group::curl_config.h (raw)'; cat lib/curl_config.h || true; echo '::endgroup::'
218            echo '::group::curl_config.h'; grep -F '#define' lib/curl_config.h | sort || true; echo '::endgroup::'
219            time gmake -j3 install
220            src/curl --disable --version
221            time gmake -j3 -C tests
222            time gmake test-ci V=1
223            echo '::group::build examples'
224            time gmake -j3 examples
225            echo '::endgroup::'
226
227  ios:
228    name: "iOS, ${{ (matrix.build.generator && format('CM-{0}', matrix.build.generator)) || (matrix.build.generate && 'CM' || 'AM' )}} ${{ matrix.build.name }} arm64"
229    runs-on: 'macos-latest'
230    timeout-minutes: 10
231    env:
232      DEVELOPER_DIR: "/Applications/Xcode${{ matrix.build.xcode && format('_{0}', matrix.build.xcode) || '' }}.app/Contents/Developer"
233      CC: ${{ matrix.build.compiler || 'clang' }}
234      MAKEFLAGS: -j 4
235      # renovate: datasource=github-tags depName=libressl-portable/portable versioning=semver registryUrl=https://github.com
236      libressl-version: 4.0.0
237    strategy:
238      fail-fast: false
239      matrix:
240        build:
241          - name: 'libressl'
242            install_steps: libressl
243            configure: --with-openssl="$HOME/libressl" --without-libpsl
244
245          - name: 'libressl'
246            install_steps: libressl
247            # FIXME: Could not make OPENSSL_ROOT_DIR work. CMake seems to prepend sysroot to it.
248            generate: >-
249              -DOPENSSL_INCLUDE_DIR="$HOME/libressl/include"
250              -DOPENSSL_SSL_LIBRARY="$HOME/libressl/lib/libssl.a"
251              -DOPENSSL_CRYPTO_LIBRARY="$HOME/libressl/lib/libcrypto.a"
252              -DCURL_USE_LIBPSL=OFF
253
254          - name: 'libressl'
255            install_steps: libressl
256            generator: Xcode
257            generate: >-
258              -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED=OFF
259              -DMACOSX_BUNDLE_GUI_IDENTIFIER=se.curl
260              -DOPENSSL_INCLUDE_DIR="$HOME/libressl/include"
261              -DOPENSSL_SSL_LIBRARY="$HOME/libressl/lib/libssl.a"
262              -DOPENSSL_CRYPTO_LIBRARY="$HOME/libressl/lib/libcrypto.a"
263              -DCURL_USE_LIBPSL=OFF
264
265    steps:
266      - name: 'brew install'
267        if: ${{ matrix.build.configure }}
268        run: |
269          echo automake libtool | xargs -Ix -n1 echo brew '"x"' > /tmp/Brewfile
270          while [[ $? == 0 ]]; do for i in 1 2 3; do brew update && brew bundle install --no-lock --file /tmp/Brewfile && break 2 || { echo Error: wait to try again; sleep 10; } done; false Too many retries; done
271
272      - name: 'toolchain versions'
273        run: |
274          which "${CC}"; "${CC}" --version || true
275          xcodebuild -version || true
276          xcodebuild -sdk -version | grep '^Path:' || true
277          xcrun --sdk iphoneos --show-sdk-path 2>/dev/null || true
278          xcrun --sdk iphoneos --show-sdk-version || true
279          echo '::group::macros predefined'; "${CC}" -dM -E - < /dev/null | sort || true; echo '::endgroup::'
280          echo '::group::brew packages installed'; ls -l "$(brew --prefix)/opt"; echo '::endgroup::'
281
282      - name: 'cache libressl'
283        if: contains(matrix.build.install_steps, 'libressl')
284        uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
285        id: cache-libressl
286        env:
287          cache-name: cache-libressl
288        with:
289          path: ~/libressl
290          key: iOS-${{ env.cache-name }}-${{ env.libressl-version }}
291
292      - name: 'build libressl'
293        if: contains(matrix.build.install_steps, 'libressl') && steps.cache-libressl.outputs.cache-hit != 'true'
294        run: |
295          curl -LsSf --retry 6 --retry-connrefused --max-time 999 \
296            https://github.com/libressl/portable/releases/download/v${{ env.libressl-version }}/libressl-${{ env.libressl-version }}.tar.gz | tar -x
297          cd libressl-${{ env.libressl-version }}
298          # FIXME: on the 4.0.1 release, delete '-DHAVE_ENDIAN_H=0'
299          cmake . \
300            -DHAVE_ENDIAN_H=0 \
301            -DCMAKE_INSTALL_PREFIX="$HOME/libressl" \
302            -DCMAKE_SYSTEM_NAME=iOS \
303            -DCMAKE_SYSTEM_PROCESSOR=aarch64 \
304            -DBUILD_SHARED_LIBS=OFF \
305            -DLIBRESSL_APPS=OFF \
306            -DLIBRESSL_TESTS=OFF
307          cmake --build .
308          cmake --install . --verbose
309
310      - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
311        with:
312          persist-credentials: false
313
314      - name: 'autoreconf'
315        if: ${{ matrix.build.configure }}
316        run: autoreconf -fi
317
318      - name: 'configure'
319        run: |
320          if [ -n '${{ matrix.build.generate }}' ]; then
321            # https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html#cross-compiling-for-ios-tvos-visionos-or-watchos
322            [ -n '${{ matrix.build.generator }}' ] && options='-G ${{ matrix.build.generator }}'
323            cmake -B bld -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON -DCURL_WERROR=ON \
324              -DCMAKE_SYSTEM_NAME=iOS \
325              -DUSE_APPLE_IDN=ON \
326              ${{ matrix.build.generate }} ${options}
327          else
328            mkdir bld && cd bld && ../configure --enable-unity --enable-test-bundles --enable-warnings --enable-werror \
329              --disable-dependency-tracking \
330              CFLAGS="-isysroot $(xcrun --sdk iphoneos --show-sdk-path 2>/dev/null)" \
331              --host=aarch64-apple-darwin \
332              --with-apple-idn \
333              ${{ matrix.build.configure }}
334          fi
335
336      - name: 'configure log'
337        if: ${{ !cancelled() }}
338        run: cat bld/config.log bld/CMakeFiles/CMakeConfigureLog.yaml 2>/dev/null || true
339
340      - name: 'curl_config.h'
341        run: |
342          echo '::group::raw'; cat bld/lib/curl_config.h || true; echo '::endgroup::'
343          grep -F '#define' bld/lib/curl_config.h | sort || true
344
345      - name: 'build'
346        run: |
347          if [ -n '${{ matrix.build.generate }}' ]; then
348            cmake --build bld --verbose
349          else
350            make -C bld V=1
351          fi
352
353      - name: 'curl info'
354        run: find . -type f \( -name curl -o -name '*.dylib' -o -name '*.a' \) -exec file '{}' \;
355
356      - name: 'build tests'
357        run: |
358          if [ -n '${{ matrix.build.generate }}' ]; then
359            cmake --build bld --target testdeps --verbose
360          else
361            make -C bld V=1 -C tests
362          fi
363
364      - name: 'build examples'
365        run: |
366          if [ -n '${{ matrix.build.generate }}' ]; then
367            cmake --build bld --target curl-examples --verbose
368          else
369            make -C bld examples V=1
370          fi
371
372  android:
373    name: "Android ${{ matrix.platform }}, ${{ matrix.build == 'cmake' && 'CM' || 'AM' }} ${{ matrix.name }} arm64"
374    runs-on: 'ubuntu-latest'
375    timeout-minutes: 25
376    env:
377      VCPKG_BINARY_SOURCES: 'clear;x-gha,readwrite'
378      VCPKG_DISABLE_METRICS: '1'
379      MAKEFLAGS: -j 5
380    strategy:
381      matrix:
382        include:
383          - { build: 'autotools', platform: '21', name: "openssl", install: 'brotli zstd libpsl nghttp2 openssl libssh2',
384              options: '--with-openssl --with-brotli' }
385
386          - { build: 'cmake'    , platform: '21', name: "openssl", install: 'brotli zstd libpsl nghttp2 openssl libssh2',
387              options: '-DCURL_USE_OPENSSL=ON' }
388
389          - { build: 'autotools', platform: '35', name: "openssl", install: 'brotli zstd libpsl nghttp2 openssl libssh2',
390              options: '--with-openssl --with-brotli' }
391
392          - { build: 'cmake'    , platform: '35', name: "openssl", install: 'brotli zstd libpsl nghttp2 openssl libssh2',
393              options: '-DCURL_USE_OPENSSL=ON' }
394
395          # FIXME: Must disable zstd explicitly, otherwise cmake/pkg-config finds it in /usr/include
396          #        and the build fails. I had found no option to disable this behavior. Other default
397          #        dependencies not offered via vcpkg may also need this.
398          - { build: 'cmake'    , platform: '35', name: "boringssl !zstd", install: 'libpsl boringssl',
399              options: '-DCURL_USE_OPENSSL=ON -DOPENSSL_USE_STATIC_LIBS=ON -DCURL_ZSTD=OFF' }
400
401      fail-fast: false
402    steps:
403      - name: 'vcpkg cache setup'
404        if: ${{ matrix.install }}
405        uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7
406        with:
407          script: |
408            core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
409            core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
410
411      - name: 'vcpkg versions'
412        if: ${{ matrix.install }}
413        timeout-minutes: 1
414        run: |
415          git -C "$VCPKG_INSTALLATION_ROOT" show --no-patch --format='%H %ai'
416          vcpkg version
417
418      - name: 'install prereqs for vcpkg'
419        if: contains(matrix.install, 'boringssl')
420        timeout-minutes: 5
421        run: |
422          sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
423          sudo apt-get -o Dpkg::Use-Pty=0 update
424          sudo apt-get -o Dpkg::Use-Pty=0 install nasm
425
426      - name: 'vcpkg build'
427        if: ${{ matrix.install }}
428        timeout-minutes: 20
429        run: vcpkg x-set-installed ${{ matrix.install }} '--triplet=arm64-android'
430
431      - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
432        with:
433          persist-credentials: false
434
435      - name: 'autoreconf'
436        if: ${{ matrix.build == 'autotools' }}
437        run: autoreconf -fi
438
439      - name: 'configure'
440        run: |
441          export PKG_CONFIG_PATH="$VCPKG_INSTALLATION_ROOT/installed/arm64-android/lib/pkgconfig"
442          if [ '${{ matrix.build }}' = 'cmake' ]; then  # https://developer.android.com/ndk/guides/cmake
443            cmake -B bld \
444              -DANDROID_ABI=arm64-v8a \
445              -DANDROID_PLATFORM='android-${{ matrix.platform }}' \
446              -DCMAKE_TOOLCHAIN_FILE="$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" \
447              -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=${ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake -DCMAKE_WARN_DEPRECATED=OFF \
448              -DVCPKG_INSTALLED_DIR="$VCPKG_INSTALLATION_ROOT/installed" \
449              -DVCPKG_TARGET_TRIPLET=arm64-android \
450              -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \
451              -DCURL_WERROR=ON \
452              ${{ matrix.options }}
453          else
454            TOOLCHAIN="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64"
455            mkdir bld && cd bld && ../configure --disable-dependency-tracking --enable-unity --enable-test-bundles --enable-warnings --enable-werror \
456              CC="$TOOLCHAIN/bin/aarch64-linux-android${{ matrix.platform }}-clang" \
457              AR="$TOOLCHAIN/bin/llvm-ar" \
458              RANLIB="$TOOLCHAIN/bin/llvm-ranlib" \
459              --host=aarch64-linux-android${{ matrix.platform }} \
460              ${{ matrix.options }}
461          fi
462
463      - name: 'configure log'
464        if: ${{ !cancelled() }}
465        run: cat bld/config.log bld/CMakeFiles/CMake*.yaml 2>/dev/null || true
466
467      - name: 'curl_config.h'
468        run: |
469          echo '::group::raw'; cat bld/lib/curl_config.h || true; echo '::endgroup::'
470          grep -F '#define' bld/lib/curl_config.h | sort || true
471
472      - name: 'build'
473        run: |
474          if [ '${{ matrix.build }}' = 'cmake' ]; then
475            cmake --build bld --verbose
476          else
477            make -j5 -C bld V=1
478          fi
479
480      - name: 'curl info'
481        run: find . -type f \( -name curl -o -name '*.so' -o -name '*.a' \) -exec file '{}' \;
482
483      - name: 'build tests'
484        run: |
485          if [ '${{ matrix.build }}' = 'cmake' ]; then
486            cmake --build bld --target testdeps
487          else
488            make -j5 -C bld -C tests
489          fi
490
491      - name: 'build examples'
492        run: |
493          if [ '${{ matrix.build }}' = 'cmake' ]; then
494            cmake --build bld --target curl-examples
495          else
496            make -j5 -C bld examples
497          fi
498
499  amiga:
500    name: "AmigaOS, ${{ matrix.build == 'cmake' && 'CM' || 'AM' }} gcc AmiSSL m68k"
501    runs-on: 'ubuntu-latest'
502    timeout-minutes: 5
503    env:
504      amissl-version: 5.18
505    strategy:
506      matrix:
507        build: [autotools, cmake]
508      fail-fast: false
509    steps:
510      - name: 'install compiler'
511        if: ${{ steps.cache-compiler.outputs.cache-hit != 'true' }}
512        run: |
513          cd "${HOME}" || exit 1
514          curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 120 --retry 3 \
515            --location https://github.com/bebbo/amiga-gcc/releases/download/Mechen/amiga-gcc.tgz | tar -xz
516          cd opt/appveyor || exit 1
517          curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 \
518            --location https://github.com/jens-maus/amissl/releases/download/${{ env.amissl-version }}/AmiSSL-${{ env.amissl-version }}-SDK.lha --output bin.lha
519          7z x -bd -y bin.lha
520          rm -f bin.lha
521          mv "$HOME/opt/appveyor" /opt
522
523      - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
524        with:
525          persist-credentials: false
526
527      - name: 'configure'
528        run: |
529          if [ '${{ matrix.build }}' = 'cmake' ]; then
530            cmake -B bld \
531              -DAMIGA=1 \
532              -DCMAKE_SYSTEM_NAME=Generic \
533              -DCMAKE_SYSTEM_PROCESSOR=m68k \
534              -DCMAKE_C_COMPILER_TARGET=m68k-unknown-amigaos \
535              -DCMAKE_C_COMPILER=/opt/appveyor/build-agent/opt/amiga/bin/m68k-amigaos-gcc \
536              -DCMAKE_C_FLAGS='-O0 -msoft-float -mcrt=clib2' \
537              -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \
538              -DCURL_WERROR=ON \
539              -DCURL_USE_LIBPSL=OFF \
540              -DAMISSL_INCLUDE_DIR=/opt/appveyor/AmiSSL/Developer/include \
541              -DAMISSL_STUBS_LIBRARY=/opt/appveyor/AmiSSL/Developer/lib/AmigaOS3/libamisslstubs.a \
542              -DAMISSL_AUTO_LIBRARY=/opt/appveyor/AmiSSL/Developer/lib/AmigaOS3/libamisslauto.a
543          else
544            autoreconf -fi
545            mkdir bld && cd bld && ../configure --disable-dependency-tracking --enable-unity --enable-test-bundles --enable-warnings --enable-werror \
546              CC=/opt/appveyor/build-agent/opt/amiga/bin/m68k-amigaos-gcc \
547              AR=/opt/appveyor/build-agent/opt/amiga/bin/m68k-amigaos-ar \
548              RANLIB=/opt/appveyor/build-agent/opt/amiga/bin/m68k-amigaos-ranlib \
549              --host=m68k-amigaos \
550              --disable-shared \
551              --without-libpsl \
552              --with-amissl \
553              LDFLAGS=-L/opt/appveyor/AmiSSL/Developer/lib/AmigaOS3 \
554              CPPFLAGS=-I/opt/appveyor/AmiSSL/Developer/include \
555              CFLAGS='-O0 -msoft-float -mcrt=clib2' \
556              LIBS='-lnet -lm -latomic'
557          fi
558
559      - name: 'configure log'
560        if: ${{ !cancelled() }}
561        run: cat bld/config.log bld/CMakeFiles/CMake*.yaml 2>/dev/null || true
562
563      - name: 'curl_config.h'
564        run: |
565          echo '::group::raw'; cat bld/lib/curl_config.h || true; echo '::endgroup::'
566          grep -F '#define' bld/lib/curl_config.h | sort || true
567
568      - name: 'build'
569        run: |
570          if [ '${{ matrix.build }}' = 'cmake' ]; then
571            cmake --build bld --parallel 5
572          else
573            make -j5 -C bld
574          fi
575
576      - name: 'curl info'
577        run: find . -type f \( -name curl -o -name '*.a' \) -exec file '{}' \;
578
579      - name: 'build tests'
580        if: ${{ matrix.build == 'cmake' }}  # skip for autotools to save time
581        run: |
582          if [ '${{ matrix.build }}' = 'cmake' ]; then
583            cmake --build bld --parallel 5 --target testdeps
584          else
585            make -j5 -C bld -C tests
586          fi
587
588      - name: 'build examples'
589        if: ${{ matrix.build == 'cmake' }}  # skip for autotools to save time
590        run: |
591          if [ '${{ matrix.build }}' = 'cmake' ]; then
592            cmake --build bld --parallel 5 --target curl-examples
593          else
594            make -j5 -C bld examples
595          fi
596
597  msdos:
598    name: "MS-DOS, ${{ matrix.build == 'cmake' && 'CM' || 'AM' }} djgpp openssl i586"
599    runs-on: 'ubuntu-latest'
600    timeout-minutes: 5
601    env:
602      toolchain-version: '3.4'
603    strategy:
604      matrix:
605        build: [autotools, cmake]
606      fail-fast: false
607    steps:
608      - name: 'install packages'
609        run: sudo apt-get -o Dpkg::Use-Pty=0 install libfl2 ${{ matrix.build == 'cmake' && 'ninja-build' || '' }}
610
611      - name: 'cache compiler (djgpp)'
612        uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
613        id: cache-compiler
614        with:
615          path: ~/djgpp
616          key: ${{ runner.os }}-djgpp-${{ env.toolchain-version }}-amd64
617
618      - name: 'install compiler (djgpp)'
619        if: ${{ steps.cache-compiler.outputs.cache-hit != 'true' }}
620        run: |
621          cd "${HOME}" || exit 1
622          curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 120 --retry 3 \
623            --location 'https://github.com/andrewwutw/build-djgpp/releases/download/v${{ env.toolchain-version }}/djgpp-linux64-gcc1220.tar.bz2' | tar -xj
624          cd djgpp || exit 1
625          for f in wat3211b.zip zlb13b.zip ssl102ub.zip; do
626            curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 \
627              "https://www.delorie.com/pub/djgpp/current/v2tk/$f" --output bin.zip
628            unzip -q bin.zip
629            rm -f bin.zip
630          done
631
632      - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
633        with:
634          persist-credentials: false
635
636      - name: 'configure'
637        run: |
638          if [ '${{ matrix.build }}' = 'cmake' ]; then
639            cmake -B bld -G Ninja \
640              -DCMAKE_SYSTEM_NAME=DOS \
641              -DCMAKE_SYSTEM_PROCESSOR=x86 \
642              -DCMAKE_C_COMPILER_TARGET=i586-pc-msdosdjgpp \
643              -DCMAKE_C_COMPILER="$HOME/djgpp/bin/i586-pc-msdosdjgpp-gcc" \
644              -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \
645              -DCURL_WERROR=ON \
646              -DCURL_USE_LIBPSL=OFF \
647              -DOPENSSL_INCLUDE_DIR="$HOME/djgpp/include" \
648              -DOPENSSL_SSL_LIBRARY="$HOME/djgpp/lib/libssl.a" \
649              -DOPENSSL_CRYPTO_LIBRARY="$HOME/djgpp/lib/libcrypto.a" \
650              -DZLIB_INCLUDE_DIR="$HOME/djgpp/include" \
651              -DZLIB_LIBRARY="$HOME/djgpp/lib/libz.a" \
652              -DWATT_ROOT="$HOME/djgpp/net/watt"
653          else
654            autoreconf -fi
655            mkdir bld && cd bld && ../configure --disable-dependency-tracking --enable-unity --enable-test-bundles --enable-warnings --enable-werror \
656              CC="$HOME/djgpp/bin/i586-pc-msdosdjgpp-gcc" \
657              AR="$HOME/djgpp/bin/i586-pc-msdosdjgpp-ar" \
658              RANLIB="$HOME/djgpp/bin/i586-pc-msdosdjgpp-ranlib" \
659              WATT_ROOT="$HOME/djgpp/net/watt" \
660              --host=i586-pc-msdosdjgpp \
661              --with-openssl="$HOME/djgpp" \
662              --with-zlib="$HOME/djgpp" \
663              --without-libpsl \
664              --disable-shared
665          fi
666
667      - name: 'configure log'
668        if: ${{ !cancelled() }}
669        run: cat bld/config.log bld/CMakeFiles/CMake*.yaml 2>/dev/null || true
670
671      - name: 'curl_config.h'
672        run: |
673          echo '::group::raw'; cat bld/lib/curl_config.h || true; echo '::endgroup::'
674          grep -F '#define' bld/lib/curl_config.h | sort || true
675
676      - name: 'build'
677        run: |
678          if [ '${{ matrix.build }}' = 'cmake' ]; then
679            cmake --build bld
680          else
681            make -j5 -C bld
682          fi
683
684      - name: 'curl info'
685        run: find . \( -name '*.exe' -o -name '*.a' \) -exec file '{}' \;
686
687      - name: 'build tests'
688        if: ${{ matrix.build == 'cmake' }}  # skip for autotools to save time
689        run: |
690          if [ '${{ matrix.build }}' = 'cmake' ]; then
691            cmake --build bld --target testdeps
692          else
693            make -j5 -C bld -C tests
694          fi
695
696      - name: 'build examples'
697        if: ${{ matrix.build == 'cmake' }}  # skip for autotools to save time
698        run: |
699          if [ '${{ matrix.build }}' = 'cmake' ]; then
700            cmake --build bld --target curl-examples
701          else
702            make -j5 -C bld examples
703          fi
704