non-native.yml 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421
  1. # Copyright (C) Viktor Szakats
  2. #
  3. # SPDX-License-Identifier: curl
  4. name: non-native
  5. 'on':
  6. push:
  7. branches:
  8. - master
  9. - '*/ci'
  10. paths-ignore:
  11. - '**/*.md'
  12. - '.circleci/**'
  13. - 'appveyor.*'
  14. - 'packages/**'
  15. - 'plan9/**'
  16. - 'projects/**'
  17. - 'winbuild/**'
  18. pull_request:
  19. branches:
  20. - master
  21. paths-ignore:
  22. - '**/*.md'
  23. - '.circleci/**'
  24. - 'appveyor.*'
  25. - 'packages/**'
  26. - 'plan9/**'
  27. - 'projects/**'
  28. - 'winbuild/**'
  29. concurrency:
  30. group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
  31. cancel-in-progress: true
  32. permissions: {}
  33. jobs:
  34. netbsd:
  35. name: 'NetBSD (CM, openssl, clang)'
  36. runs-on: ubuntu-latest
  37. timeout-minutes: 30
  38. strategy:
  39. matrix:
  40. arch: ['x86_64']
  41. steps:
  42. - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
  43. with:
  44. persist-credentials: false
  45. - name: 'cmake'
  46. uses: cross-platform-actions/action@a0672d7f6de3a78e7784bbaf491c7303f68d94b3 # v0.26.0
  47. with:
  48. operating_system: 'netbsd'
  49. version: '10.0'
  50. architecture: ${{ matrix.arch }}
  51. run: |
  52. # https://pkgsrc.se/
  53. sudo pkgin -y install cmake ninja-build pkg-config perl brotli heimdal openldap-client libssh2 libidn2 libpsl nghttp2 py311-impacket
  54. cmake -B bld -G Ninja \
  55. -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \
  56. -DCURL_WERROR=ON \
  57. -DENABLE_DEBUG=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG= \
  58. -DCURL_USE_OPENSSL=ON \
  59. -DCURL_USE_GSSAPI=ON \
  60. || { cat bld/CMakeFiles/CMake*.yaml; false; }
  61. echo '::group::curl_config.h (raw)'; cat bld/lib/curl_config.h || true; echo '::endgroup::'
  62. echo '::group::curl_config.h'; grep -F '#define' bld/lib/curl_config.h | sort || true; echo '::endgroup::'
  63. cmake --build bld --config Debug
  64. bld/src/curl --disable --version
  65. if [ '${{ matrix.arch }}' = 'x86_64' ]; then # Slow on emulated CPU
  66. cmake --build bld --config Debug --target testdeps
  67. export TFLAGS='-j4'
  68. cmake --build bld --config Debug --target test-ci
  69. fi
  70. echo '::group::build examples'
  71. cmake --build bld --config Debug --target curl-examples
  72. echo '::endgroup::'
  73. openbsd:
  74. name: 'OpenBSD (CM, libressl, clang)'
  75. runs-on: ubuntu-latest
  76. timeout-minutes: 30
  77. strategy:
  78. matrix:
  79. arch: ['x86_64']
  80. steps:
  81. - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
  82. with:
  83. persist-credentials: false
  84. - name: 'cmake'
  85. uses: cross-platform-actions/action@a0672d7f6de3a78e7784bbaf491c7303f68d94b3 # v0.26.0
  86. with:
  87. operating_system: 'openbsd'
  88. version: '7.5'
  89. architecture: ${{ matrix.arch }}
  90. run: |
  91. # https://openbsd.app/
  92. # https://www.openbsd.org/faq/faq15.html
  93. sudo pkg_add cmake ninja brotli openldap-client-- libssh2 libidn2 libpsl nghttp2 python3 py3-impacket
  94. cmake -B bld -G Ninja \
  95. -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \
  96. -DCURL_WERROR=ON \
  97. -DENABLE_DEBUG=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG= \
  98. -DCURL_USE_OPENSSL=ON \
  99. || { cat bld/CMakeFiles/CMake*.yaml; false; }
  100. echo '::group::curl_config.h (raw)'; cat bld/lib/curl_config.h || true; echo '::endgroup::'
  101. echo '::group::curl_config.h'; grep -F '#define' bld/lib/curl_config.h | sort || true; echo '::endgroup::'
  102. cmake --build bld --config Debug
  103. bld/src/curl --disable --version
  104. if [ '${{ matrix.arch }}' = 'x86_64' ]; then # Slow on emulated CPU
  105. cmake --build bld --config Debug --target testdeps
  106. export TFLAGS='-j8 ~3017 ~TFTP ~FTP' # FIXME: TFTP requests executed twice? Related: `curl: (69) TFTP: Access Violation`?
  107. cmake --build bld --config Debug --target test-ci
  108. fi
  109. echo '::group::build examples'
  110. cmake --build bld --config Debug --target curl-examples
  111. echo '::endgroup::'
  112. freebsd:
  113. name: "FreeBSD (${{ matrix.build && 'CM' || 'AM' }}, openssl, ${{ matrix.compiler }}, ${{ matrix.arch }})"
  114. runs-on: ubuntu-latest
  115. timeout-minutes: 60
  116. strategy:
  117. matrix:
  118. include:
  119. - { build: 'autotools', arch: 'x86_64', compiler: 'clang' }
  120. - { build: 'autotools', arch: 'arm64', compiler: 'clang' }
  121. - { build: 'cmake' , arch: 'arm64', compiler: 'clang' }
  122. fail-fast: false
  123. steps:
  124. - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
  125. with:
  126. persist-credentials: false
  127. - name: 'autotools'
  128. if: ${{ matrix.build == 'autotools' }}
  129. uses: cross-platform-actions/action@a0672d7f6de3a78e7784bbaf491c7303f68d94b3 # v0.26.0
  130. with:
  131. operating_system: 'freebsd'
  132. version: '14.1'
  133. architecture: ${{ matrix.arch }}
  134. run: |
  135. # https://ports.freebsd.org/
  136. sudo pkg install -y autoconf automake libtool \
  137. pkgconf brotli openldap26-client libidn2 libnghttp2 stunnel py311-impacket
  138. autoreconf -fi
  139. export CC='${{ matrix.compiler }}'
  140. mkdir bld && cd bld && ../configure --enable-unity --enable-test-bundles --enable-debug --enable-warnings --enable-werror \
  141. --prefix="${HOME}"/install \
  142. --with-openssl \
  143. --with-brotli --enable-ldap --enable-ldaps --with-libidn2 --with-libssh2 --with-nghttp2 --with-gssapi \
  144. --disable-dependency-tracking || { tail -n 1000 config.log; false; }
  145. echo '::group::curl_config.h (raw)'; cat lib/curl_config.h || true; echo '::endgroup::'
  146. echo '::group::curl_config.h'; grep -F '#define' lib/curl_config.h | sort || true; echo '::endgroup::'
  147. make -j3 install
  148. src/curl --disable --version
  149. if [ '${{ matrix.arch }}' = 'x86_64' ]; then # Slow on emulated CPU
  150. make -j3 -C tests
  151. make test-ci V=1 TFLAGS='-j4'
  152. fi
  153. echo '::group::build examples'
  154. make -j3 examples
  155. echo '::endgroup::'
  156. - name: 'cmake'
  157. if: ${{ matrix.build == 'cmake' }}
  158. uses: cross-platform-actions/action@a0672d7f6de3a78e7784bbaf491c7303f68d94b3 # v0.26.0
  159. with:
  160. operating_system: 'freebsd'
  161. version: '14.1'
  162. architecture: ${{ matrix.arch }}
  163. run: |
  164. # https://ports.freebsd.org/
  165. sudo pkg install -y cmake-core ninja perl5 \
  166. pkgconf brotli openldap26-client libidn2 libnghttp2 stunnel py311-impacket
  167. cmake -B bld -G Ninja \
  168. '-DCMAKE_C_COMPILER=${{ matrix.compiler }}' \
  169. -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \
  170. -DCURL_WERROR=ON \
  171. -DENABLE_DEBUG=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG= \
  172. -DCURL_USE_OPENSSL=ON \
  173. -DCURL_USE_GSSAPI=ON \
  174. || { cat bld/CMakeFiles/CMake*.yaml; false; }
  175. echo '::group::curl_config.h (raw)'; cat bld/lib/curl_config.h || true; echo '::endgroup::'
  176. echo '::group::curl_config.h'; grep -F '#define' bld/lib/curl_config.h | sort || true; echo '::endgroup::'
  177. cmake --build bld --config Debug
  178. bld/src/curl --disable --version
  179. if [ '${{ matrix.arch }}' = 'x86_64' ]; then # Slow on emulated CPU
  180. cmake --build bld --config Debug --target testdeps
  181. cmake --build bld --config Debug --target test-ci
  182. fi
  183. echo '::group::build examples'
  184. cmake --build bld --config Debug --target curl-examples
  185. echo '::endgroup::'
  186. omnios:
  187. name: 'OmniOS (AM, openssl, gcc, amd64)'
  188. runs-on: ubuntu-latest
  189. timeout-minutes: 30
  190. steps:
  191. - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
  192. with:
  193. persist-credentials: false
  194. - name: 'autotools'
  195. uses: vmactions/omnios-vm@16b5996777bc675acd3d537f13df536a526cd16d # v1
  196. with:
  197. usesh: true
  198. # https://pkg.omnios.org/r151052/core/en/index.shtml
  199. prepare: pkg install build-essential libtool nghttp2
  200. run: |
  201. set -e
  202. ln -s /usr/bin/gcpp /usr/bin/cpp # Some tests expect `cpp`, which is named `gcpp` in this env.
  203. autoreconf -fi
  204. mkdir bld && cd bld && ../configure --enable-unity --enable-test-bundles --enable-debug --enable-warnings --enable-werror \
  205. --prefix="${HOME}"/install \
  206. --with-openssl \
  207. --disable-dependency-tracking || { tail -n 1000 config.log; false; }
  208. echo '::group::curl_config.h (raw)'; cat lib/curl_config.h || true; echo '::endgroup::'
  209. echo '::group::curl_config.h'; grep -F '#define' lib/curl_config.h | sort || true; echo '::endgroup::'
  210. gmake -j3 install
  211. src/curl --disable --version
  212. gmake -j3 -C tests
  213. gmake test-ci V=1
  214. echo '::group::build examples'
  215. gmake -j3 examples
  216. echo '::endgroup::'
  217. amiga:
  218. name: "AmigaOS (${{ matrix.build == 'cmake' && 'CM' || 'AM' }}, AmiSSL, gcc, m68k)"
  219. runs-on: 'ubuntu-24.04'
  220. timeout-minutes: 30
  221. env:
  222. amissl-version: 5.18
  223. strategy:
  224. matrix:
  225. build: [autotools, cmake]
  226. fail-fast: false
  227. steps:
  228. - name: 'install compiler'
  229. if: ${{ steps.cache-compiler.outputs.cache-hit != 'true' }}
  230. run: |
  231. cd "${HOME}" || exit 1
  232. curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 120 --retry 3 \
  233. --location https://github.com/bebbo/amiga-gcc/releases/download/Mechen/amiga-gcc.tgz | tar -xz
  234. cd opt/appveyor || exit 1
  235. curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 \
  236. --location https://github.com/jens-maus/amissl/releases/download/${{ env.amissl-version }}/AmiSSL-${{ env.amissl-version }}-SDK.lha --output bin.lha
  237. 7z x -bd -y bin.lha
  238. rm -f bin.lha
  239. mv "$HOME/opt/appveyor" /opt
  240. - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
  241. - name: 'configure'
  242. run: |
  243. if [ '${{ matrix.build }}' = 'cmake' ]; then
  244. cmake -B bld \
  245. -DAMIGA=1 \
  246. -DCMAKE_SYSTEM_NAME=Generic \
  247. -DCMAKE_SYSTEM_PROCESSOR=m68k \
  248. -DCMAKE_C_COMPILER_TARGET=m68k-unknown-amigaos \
  249. -DCMAKE_C_COMPILER=/opt/appveyor/build-agent/opt/amiga/bin/m68k-amigaos-gcc \
  250. -DCMAKE_C_FLAGS='-O0 -msoft-float -mcrt=clib2' \
  251. -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \
  252. -DCURL_WERROR=ON \
  253. -DCURL_USE_LIBPSL=OFF \
  254. -DAMISSL_INCLUDE_DIR=/opt/appveyor/AmiSSL/Developer/include \
  255. -DAMISSL_STUBS_LIBRARY=/opt/appveyor/AmiSSL/Developer/lib/AmigaOS3/libamisslstubs.a \
  256. -DAMISSL_AUTO_LIBRARY=/opt/appveyor/AmiSSL/Developer/lib/AmigaOS3/libamisslauto.a
  257. else
  258. autoreconf -fi
  259. mkdir bld && cd bld && ../configure --disable-dependency-tracking --enable-unity --enable-test-bundles --enable-warnings --enable-werror \
  260. CC=/opt/appveyor/build-agent/opt/amiga/bin/m68k-amigaos-gcc \
  261. AR=/opt/appveyor/build-agent/opt/amiga/bin/m68k-amigaos-ar \
  262. RANLIB=/opt/appveyor/build-agent/opt/amiga/bin/m68k-amigaos-ranlib \
  263. --host=m68k-amigaos \
  264. --disable-shared \
  265. --without-libpsl \
  266. --with-amissl \
  267. LDFLAGS=-L/opt/appveyor/AmiSSL/Developer/lib/AmigaOS3 \
  268. CPPFLAGS=-I/opt/appveyor/AmiSSL/Developer/include \
  269. CFLAGS='-O0 -msoft-float -mcrt=clib2' \
  270. LIBS='-lnet -lm -latomic'
  271. fi
  272. - name: 'configure log'
  273. if: ${{ !cancelled() }}
  274. run: cat bld/config.log bld/CMakeFiles/CMake*.yaml 2>/dev/null || true
  275. - name: 'curl_config.h'
  276. run: |
  277. echo '::group::raw'; cat bld/lib/curl_config.h || true; echo '::endgroup::'
  278. grep -F '#define' bld/lib/curl_config.h | sort || true
  279. - name: 'build'
  280. run: |
  281. if [ '${{ matrix.build }}' = 'cmake' ]; then
  282. cmake --build bld --parallel 5
  283. else
  284. make -j5 -C bld
  285. fi
  286. - name: 'build tests'
  287. if: ${{ matrix.build == 'cmake' }} # skip for autotools to save time
  288. run: |
  289. if [ '${{ matrix.build }}' = 'cmake' ]; then
  290. cmake --build bld --parallel 5 --target testdeps
  291. else
  292. make -j5 -C bld -C tests
  293. fi
  294. - name: 'build examples'
  295. if: ${{ matrix.build == 'cmake' }} # skip for autotools to save time
  296. run: |
  297. if [ '${{ matrix.build }}' = 'cmake' ]; then
  298. cmake --build bld --parallel 5 --target curl-examples
  299. else
  300. make -j5 -C bld examples
  301. fi
  302. msdos:
  303. name: "MS-DOS (${{ matrix.build == 'cmake' && 'CM' || 'AM' }}, openssl, djgpp, i586)"
  304. runs-on: 'ubuntu-24.04'
  305. timeout-minutes: 30
  306. env:
  307. toolchain-version: '3.4'
  308. strategy:
  309. matrix:
  310. build: [autotools, cmake]
  311. fail-fast: false
  312. steps:
  313. - name: 'install packages'
  314. run: sudo apt-get --quiet 2 --option Dpkg::Use-Pty=0 install libfl2 ${{ matrix.build == 'cmake' && 'ninja-build' || '' }}
  315. - name: 'cache compiler (djgpp)'
  316. uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4
  317. id: cache-compiler
  318. with:
  319. path: ~/djgpp
  320. key: ${{ runner.os }}-djgpp-${{ env.toolchain-version }}-amd64
  321. - name: 'install compiler (djgpp)'
  322. if: ${{ steps.cache-compiler.outputs.cache-hit != 'true' }}
  323. run: |
  324. cd "${HOME}" || exit 1
  325. curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 120 --retry 3 \
  326. --location 'https://github.com/andrewwutw/build-djgpp/releases/download/v${{ env.toolchain-version }}/djgpp-linux64-gcc1220.tar.bz2' | tar -xj
  327. cd djgpp || exit 1
  328. for f in wat3211b.zip zlb13b.zip ssl102ub.zip; do
  329. curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 \
  330. "https://www.delorie.com/pub/djgpp/current/v2tk/$f" --output bin.zip
  331. unzip -q bin.zip
  332. rm -f bin.zip
  333. done
  334. - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
  335. - name: 'configure'
  336. run: |
  337. if [ '${{ matrix.build }}' = 'cmake' ]; then
  338. cmake -B bld -G Ninja \
  339. -DCMAKE_SYSTEM_NAME=DOS \
  340. -DCMAKE_SYSTEM_PROCESSOR=x86 \
  341. -DCMAKE_C_COMPILER_TARGET=i586-pc-msdosdjgpp \
  342. -DCMAKE_C_COMPILER=$HOME/djgpp/bin/i586-pc-msdosdjgpp-gcc \
  343. -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \
  344. -DCURL_WERROR=ON \
  345. -DCURL_USE_LIBPSL=OFF \
  346. -DOPENSSL_INCLUDE_DIR=$HOME/djgpp/include \
  347. -DOPENSSL_SSL_LIBRARY=$HOME/djgpp/lib/libssl.a \
  348. -DOPENSSL_CRYPTO_LIBRARY=$HOME/djgpp/lib/libcrypto.a \
  349. -DZLIB_INCLUDE_DIR=$HOME/djgpp/include" \
  350. -DZLIB_LIBRARY=$HOME/djgpp/lib/libz.a" \
  351. -DWATT_ROOT=$HOME/djgpp/net/watt
  352. else
  353. autoreconf -fi
  354. mkdir bld && cd bld && ../configure --disable-dependency-tracking --enable-unity --enable-test-bundles --enable-warnings --enable-werror \
  355. CC=$HOME/djgpp/bin/i586-pc-msdosdjgpp-gcc \
  356. AR=$HOME/djgpp/bin/i586-pc-msdosdjgpp-ar \
  357. RANLIB=$HOME/djgpp/bin/i586-pc-msdosdjgpp-ranlib \
  358. WATT_ROOT=$HOME/djgpp/net/watt \
  359. --host=i586-pc-msdosdjgpp \
  360. --with-openssl=$HOME/djgpp \
  361. --with-zlib=$HOME/djgpp \
  362. --without-libpsl \
  363. --disable-shared
  364. fi
  365. - name: 'configure log'
  366. if: ${{ !cancelled() }}
  367. run: cat bld/config.log bld/CMakeFiles/CMake*.yaml 2>/dev/null || true
  368. - name: 'curl_config.h'
  369. run: |
  370. echo '::group::raw'; cat bld/lib/curl_config.h || true; echo '::endgroup::'
  371. grep -F '#define' bld/lib/curl_config.h | sort || true
  372. - name: 'build'
  373. run: |
  374. if [ '${{ matrix.build }}' = 'cmake' ]; then
  375. cmake --build bld
  376. else
  377. make -j5 -C bld
  378. fi
  379. - name: 'build tests'
  380. if: ${{ matrix.build == 'cmake' }} # skip for autotools to save time
  381. run: |
  382. if [ '${{ matrix.build }}' = 'cmake' ]; then
  383. cmake --build bld --target testdeps
  384. else
  385. make -j5 -C bld -C tests
  386. fi
  387. - name: 'build examples'
  388. if: ${{ matrix.build == 'cmake' }} # skip for autotools to save time
  389. run: |
  390. if [ '${{ matrix.build }}' = 'cmake' ]; then
  391. cmake --build bld --target curl-examples
  392. else
  393. make -j5 -C bld examples
  394. fi