xref: /curl/.circleci/config.yml (revision 1972588d)
1#***************************************************************************
2#                                  _   _ ____  _
3#  Project                     ___| | | |  _ \| |
4#                             / __| | | | |_) | |
5#                            | (__| |_| |  _ <| |___
6#                             \___|\___/|_| \_\_____|
7#
8# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
9#
10# This software is licensed as described in the file COPYING, which
11# you should have received as part of this distribution. The terms
12# are also available at https://curl.se/docs/copyright.html.
13#
14# You may opt to use, copy, modify, merge, publish, distribute and/or sell
15# copies of the Software, and permit persons to whom the Software is
16# furnished to do so, under the terms of the COPYING file.
17#
18# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19# KIND, either express or implied.
20#
21# SPDX-License-Identifier: curl
22#
23###########################################################################
24
25# View these jobs in the browser: https://app.circleci.com/pipelines/github/curl/curl
26#
27# The macOS builds use M1 (ARM) machines for platform diversity.
28# See https://circleci.com/docs/configuration-reference/#macos-execution-environment
29
30# Use the latest 2.1 version of CircleCI pipeline process engine. See: https://circleci.com/docs/2.0/configuration-reference
31version: 2.1
32
33commands:
34  configure:
35    steps:
36      - run:
37          command: |
38            autoreconf -fi
39            ./configure --enable-warnings --enable-werror --with-openssl || { tail -1000 config.log; false; }
40
41  configure-openssl-no-verbose:
42    steps:
43      - run:
44          command: |
45            autoreconf -fi
46            ./configure --disable-verbose --enable-werror --with-openssl || { tail -1000 config.log; false; }
47
48  configure-no-proxy:
49    steps:
50      - run:
51          command: |
52            autoreconf -fi
53            ./configure --disable-proxy --enable-werror --with-openssl || { tail -1000 config.log; false; }
54
55  configure-macos-normal:
56    steps:
57      - run:
58          command: |
59            autoreconf -fi
60            ./configure --enable-warnings --enable-websockets --without-ssl CFLAGS='-Wno-vla -mmacosx-version-min=10.9' CPPFLAGS="-I$(brew --prefix libpsl)/include" LDFLAGS="-L$(brew --prefix libpsl)/lib -L$(brew --prefix icu4c)/lib" LIBS="-licuuc -licudata" || { tail -1000 config.log; false; }
61
62  configure-macos-debug:
63    steps:
64      - run:
65          command: |
66            autoreconf -fi
67            ./configure --enable-warnings --enable-websockets --without-ssl --enable-debug CPPFLAGS="-I$(brew --prefix libpsl)/include" CFLAGS='-Wno-vla -mmacosx-version-min=10.9' LDFLAGS="-L$(brew --prefix libpsl)/lib -L$(brew --prefix icu4c)/lib" LIBS="-licuuc -licudata" || { tail -1000 config.log; false; }
68
69  configure-macos-libssh2:
70    steps:
71      - run:
72          command: |
73            autoreconf -fi
74            ./configure --enable-warnings --enable-websockets --without-ssl --with-libssh2=/opt/homebrew/opt/libssh2 --enable-debug CPPFLAGS="-I$(brew --prefix libpsl)/include" CFLAGS='-Wno-vla -mmacosx-version-min=10.9' LDFLAGS="-L$(brew --prefix libpsl)/lib -L$(brew --prefix icu4c)/lib" LIBS="-licuuc -licudata" || { tail -1000 config.log; false; }
75
76  configure-macos-libssh-c-ares:
77    steps:
78      - run:
79          command: |
80            autoreconf -fi
81            ./configure --enable-warnings --enable-websockets --with-openssl --with-libssh --enable-ares --enable-debug PKG_CONFIG_PATH="$(brew --prefix openssl)/lib/pkgconfig" CPPFLAGS="-I$(brew --prefix libpsl)/include" CFLAGS='-Wno-vla -mmacosx-version-min=10.9' LDFLAGS="-L$(brew --prefix libpsl)/lib -L$(brew --prefix icu4c)/lib" LIBS="-licuuc -licudata" || { tail -1000 config.log; false; }
82
83  configure-macos-libssh:
84    steps:
85      - run:
86          command: |
87            autoreconf -fi
88            ./configure --enable-warnings --enable-websockets --with-openssl --with-libssh --enable-debug PKG_CONFIG_PATH="$(brew --prefix openssl)/lib/pkgconfig" CPPFLAGS="-I$(brew --prefix libpsl)/include" CFLAGS='-Wno-vla -mmacosx-version-min=10.9' LDFLAGS="-L$(brew --prefix libpsl)/lib -L$(brew --prefix icu4c)/lib" LIBS="-licuuc -licudata" || { tail -1000 config.log; false; }
89
90  configure-macos-c-ares:
91    steps:
92      - run:
93          command: |
94            autoreconf -fi
95            ./configure --enable-warnings --enable-websockets --without-ssl --enable-ares --enable-debug CPPFLAGS="-I$(brew --prefix libpsl)/include" CFLAGS='-Wno-vla -mmacosx-version-min=10.9' LDFLAGS="-L$(brew --prefix libpsl)/lib -L$(brew --prefix icu4c)/lib" LIBS="-licuuc -licudata" || { tail -1000 config.log; false; }
96
97  configure-macos-http-only:
98    steps:
99      - run:
100          command: |
101            autoreconf -fi
102            ./configure --enable-warnings --enable-maintainer-mode --disable-dict --disable-file --disable-ftp --disable-gopher --disable-imap --disable-ldap --disable-mqtt --disable-pop3 --disable-rtsp --disable-smb --disable-smtp --disable-telnet --disable-tftp --disable-unix-sockets --disable-shared --without-brotli --without-gssapi --without-libidn2 --without-libpsl --without-librtmp --without-libssh2 --without-nghttp2 --without-ssl --without-zlib --enable-debug CFLAGS='-Wno-vla -mmacosx-version-min=10.15' || { tail -1000 config.log; false; }
103
104  configure-macos-securetransport-http2:
105    steps:
106      - run:
107          command: |
108            autoreconf -fi
109            ./configure --enable-warnings --enable-websockets --with-secure-transport CPPFLAGS="-I$(brew --prefix libpsl)/include" CFLAGS='-Wno-vla -mmacosx-version-min=10.8' LDFLAGS="-L$(brew --prefix libpsl)/lib -L$(brew --prefix icu4c)/lib" LIBS="-licuuc -licudata" || { tail -1000 config.log; false; }
110
111  configure-macos-openssl-http2:
112    steps:
113      - run:
114          command: |
115            autoreconf -fi
116            ./configure --enable-warnings --enable-websockets --with-openssl --enable-debug PKG_CONFIG_PATH="$(brew --prefix openssl)/lib/pkgconfig" CPPFLAGS="-I$(brew --prefix libpsl)/include" CFLAGS='-Wno-vla -mmacosx-version-min=10.9' LDFLAGS="-L$(brew --prefix libpsl)/lib -L$(brew --prefix icu4c)/lib" LIBS="-licuuc -licudata" || { tail -1000 config.log; false; }
117
118  configure-macos-libressl-http2:
119    steps:
120      - run:
121          command: |
122            autoreconf -fi
123            ./configure --enable-warnings --enable-websockets --with-openssl --enable-debug PKG_CONFIG_PATH="$(brew --prefix libressl)/lib/pkgconfig" CPPFLAGS="-I$(brew --prefix libpsl)/include" CFLAGS='-Wno-vla -mmacosx-version-min=10.9' LDFLAGS="-L$(brew --prefix libpsl)/lib -L$(brew --prefix icu4c)/lib" LIBS="-licuuc -licudata" || { tail -1000 config.log; false; }
124
125  configure-macos-torture:
126    steps:
127      - run:
128          command: |
129            autoreconf -fi
130            ./configure --enable-warnings --enable-websockets --disable-shared --disable-threaded-resolver --with-openssl --enable-debug PKG_CONFIG_PATH="$(brew --prefix openssl)/lib/pkgconfig" CPPFLAGS="-I$(brew --prefix libpsl)/include" CFLAGS='-Wno-vla -mmacosx-version-min=10.9' LDFLAGS="-L$(brew --prefix libpsl)/lib -L$(brew --prefix icu4c)/lib" LIBS="-licuuc -licudata" || { tail -1000 config.log; false; }
131
132  configure-macos-torture-ftp:
133    steps:
134      - run:
135          command: |
136            autoreconf -fi
137            ./configure --enable-warnings --enable-websockets --disable-shared --disable-threaded-resolver --with-openssl --enable-debug PKG_CONFIG_PATH="$(brew --prefix openssl)/lib/pkgconfig" CPPFLAGS="-I$(brew --prefix libpsl)/include" CFLAGS='-Wno-vla -mmacosx-version-min=10.9' LDFLAGS="-L$(brew --prefix libpsl)/lib -L$(brew --prefix icu4c)/lib" LIBS="-licuuc -licudata" || { tail -1000 config.log; false; }
138
139  install-cares:
140    steps:
141      - run:
142          command: |
143            sudo apt-get update && sudo apt-get install -y libc-ares-dev
144
145  install-libssh:
146    steps:
147      - run:
148          command: |
149            sudo apt-get update && sudo apt-get install -y libssh-dev
150
151  install-deps:
152    steps:
153      - run:
154          command: |
155            sudo apt-get update && sudo apt-get install -y libpsl-dev libbrotli-dev libzstd-dev zlib1g-dev python3-pip libpsl-dev
156            sudo python3 -m pip install impacket
157
158  install-deps-brew:
159    steps:
160      - run:
161          command: |
162            # Drop libressl as long as we're not trying to build it
163            echo libtool autoconf automake pkg-config nghttp2 libssh2 openssl libssh c-ares libpsl icu4c | xargs -Ix -n1 echo brew '"x"' > /tmp/Brewfile
164            while [ $? -eq 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
165            sudo python3 -m pip install impacket
166
167  configure-libssh:
168    steps:
169      - run:
170          command: |
171            autoreconf -fi
172            ./configure --enable-warnings --enable-werror --with-openssl --with-libssh || { tail -1000 config.log; false; }
173
174  install-wolfssl:
175    steps:
176      - run:
177          command: |
178            WOLFSSL_VER=5.6.0
179            curl -LOsSf --retry 6 --retry-connrefused --max-time 999 https://github.com/wolfSSL/wolfssl/archive/v$WOLFSSL_VER-stable.tar.gz
180            tar -xzf v$WOLFSSL_VER-stable.tar.gz
181            cd wolfssl-$WOLFSSL_VER-stable
182            ./autogen.sh
183            ./configure --enable-tls13 --enable-all --enable-harden --prefix=$HOME/wssl
184            make install
185
186  install-wolfssh:
187    steps:
188      - run:
189          command: |
190            WOLFSSH_VER=1.4.12
191            curl -LOsSf --retry 6 --retry-connrefused --max-time 999 https://github.com/wolfSSL/wolfssh/archive/v$WOLFSSH_VER-stable.tar.gz
192            tar -xzf v$WOLFSSH_VER-stable.tar.gz
193            cd wolfssh-$WOLFSSH_VER-stable
194            ./autogen.sh
195            ./configure --with-wolfssl=$HOME/wssl --prefix=$HOME/wssh --enable-scp --enable-sftp --disable-examples
196            make install
197
198  configure-cares:
199    steps:
200      - run:
201          command: |
202            autoreconf -fi
203            ./configure --enable-warnings --enable-werror --with-openssl --enable-ares || { tail -1000 config.log; false; }
204
205  configure-wolfssh:
206    steps:
207      - run:
208          command: |
209            autoreconf -fi
210            LDFLAGS="-Wl,-rpath,$HOME/wssh/lib" ./configure --enable-warnings --enable-werror --with-wolfssl=$HOME/wssl --with-wolfssh=$HOME/wssh || { tail -1000 config.log; false; }
211
212  configure-cares-debug:
213    steps:
214      - run:
215          command: |
216            autoreconf -fi
217            ./configure --enable-debug --enable-werror --with-openssl --enable-ares || { tail -1000 config.log; false; }
218
219  build:
220    steps:
221      - run: make -j3 V=1
222      - run: make -j3 V=1 examples
223
224  build-macos:
225    steps:
226      - run: make -j5 V=1
227      - run: make -j5 V=1 examples
228
229  test:
230    steps:
231      - run: make -j3 V=1 test-ci
232
233  test-macos:
234    steps:
235      - run: make -j5 V=1 test-ci
236
237  test-torture:
238    steps:
239      - run: make -j5 V=1 test-ci TFLAGS="-n -t --shallow=25 !FTP"
240
241  test-torture-ftp:
242    steps:
243      # Test 250 takes too long, causing Circle CI to kill the job
244      - run: make -j5 V=1 test-ci TFLAGS="-n -t --shallow=20 FTP !250 !251"
245
246executors:
247  ubuntu:
248    machine:
249      image: ubuntu-2004:2024.01.1
250
251jobs:
252  basic:
253    executor: ubuntu
254    steps:
255      - checkout
256      - install-deps
257      - configure
258      - build
259      - test
260
261  no-verbose:
262    executor: ubuntu
263    steps:
264      - checkout
265      - install-deps
266      - configure-openssl-no-verbose
267      - build
268
269  wolfssh:
270    executor: ubuntu
271    steps:
272      - checkout
273      - install-deps
274      - install-wolfssl
275      - install-wolfssh
276      - configure-wolfssh
277      - build
278
279  no-proxy:
280    executor: ubuntu
281    steps:
282      - checkout
283      - install-deps
284      - configure-no-proxy
285      - build
286      - test
287
288  cares:
289    executor: ubuntu
290    steps:
291      - checkout
292      - install-deps
293      - install-cares
294      - configure-cares
295      - build
296      - test
297
298  libssh:
299    executor: ubuntu
300    steps:
301      - checkout
302      - install-deps
303      - install-libssh
304      - configure-libssh
305      - build
306      - test
307
308  arm:
309    machine:
310      image: ubuntu-2004:2024.01.1
311    resource_class: arm.medium
312    steps:
313      - checkout
314      - install-deps
315      - configure
316      - build
317      - test
318
319  arm-cares:
320    machine:
321      image: ubuntu-2004:2024.01.1
322    resource_class: arm.medium
323    steps:
324      - checkout
325      - install-deps
326      - install-cares
327      - configure-cares-debug
328      - build
329      - test
330
331  macos-arm-normal:
332    macos:
333      xcode: 15.0.0
334    resource_class: macos.m1.medium.gen1
335    steps:
336      - checkout
337      - install-deps-brew
338      - configure-macos-normal
339      - build-macos
340      - test-macos
341
342  macos-arm-debug:
343    macos:
344      xcode: 15.0.0
345    resource_class: macos.m1.medium.gen1
346    steps:
347      - checkout
348      - install-deps-brew
349      - configure-macos-debug
350      - build-macos
351      - test-macos
352
353  macos-arm-libssh2:
354    macos:
355      xcode: 15.0.0
356    resource_class: macos.m1.medium.gen1
357    steps:
358      - checkout
359      - install-deps-brew
360      - configure-macos-libssh2
361      - build-macos
362      - test-macos
363
364  macos-arm-libssh-c-ares:
365    macos:
366      xcode: 15.0.0
367    resource_class: macos.m1.medium.gen1
368    steps:
369      - checkout
370      - install-deps-brew
371      - configure-macos-libssh-c-ares
372      - build-macos
373      - test-macos
374
375  macos-arm-libssh:
376    macos:
377      xcode: 15.0.0
378    resource_class: macos.m1.medium.gen1
379    steps:
380      - checkout
381      - install-deps-brew
382      - configure-macos-libssh
383      - build-macos
384      - test-macos
385
386  macos-arm-c-ares:
387    macos:
388      xcode: 15.0.0
389    resource_class: macos.m1.medium.gen1
390    steps:
391      - checkout
392      - install-deps-brew
393      - configure-macos-c-ares
394      - build-macos
395      - test-macos
396
397  macos-arm-http-only:
398    macos:
399      xcode: 15.0.0
400    resource_class: macos.m1.medium.gen1
401    steps:
402      - checkout
403      - install-deps-brew
404      - configure-macos-http-only
405      - build-macos
406      - test-macos
407
408  macos-arm-http-securetransport-http2:
409    macos:
410      xcode: 15.0.0
411    resource_class: macos.m1.medium.gen1
412    steps:
413      - checkout
414      - install-deps-brew
415      - configure-macos-securetransport-http2
416      - build-macos
417      - test-macos
418
419  macos-arm-http-openssl-http2:
420    macos:
421      xcode: 15.0.0
422    resource_class: macos.m1.medium.gen1
423    steps:
424      - checkout
425      - install-deps-brew
426      - configure-macos-openssl-http2
427      - build-macos
428      - test-macos
429
430  macos-arm-http-libressl-http2:
431    macos:
432      xcode: 15.0.0
433    resource_class: macos.m1.medium.gen1
434    steps:
435      - checkout
436      - install-deps-brew
437      - configure-macos-libressl-http2
438      - build-macos
439      - test-macos
440
441  macos-arm-http-torture:
442    macos:
443      xcode: 15.0.0
444    resource_class: macos.m1.medium.gen1
445    steps:
446      - checkout
447      - install-deps-brew
448      - configure-macos-torture
449      - build-macos
450      - test-torture
451
452  macos-arm-http-torture-ftp:
453    macos:
454      xcode: 15.0.0
455    resource_class: macos.m1.medium.gen1
456    steps:
457      - checkout
458      - install-deps-brew
459      - configure-macos-torture-ftp
460      - build-macos
461      - test-torture-ftp
462
463workflows:
464  x86-openssl:
465    jobs:
466      - basic
467
468  openssl-c-ares:
469    jobs:
470      - cares
471
472  openssl-libssh:
473    jobs:
474      - libssh
475
476  openssl-no-proxy:
477    jobs:
478      - no-proxy
479
480  openssl-no-verbose:
481    jobs:
482      - no-verbose
483
484  wolfssl-wolfssh:
485    jobs:
486      - wolfssh
487
488  arm-openssl:
489    jobs:
490      - arm
491
492  arm-openssl-c-ares:
493    jobs:
494      - arm-cares
495
496  macos-arm-normal:
497    jobs:
498      - macos-arm-normal
499
500  macos-arm-debug:
501    jobs:
502      - macos-arm-debug
503
504  macos-arm-libssh2:
505    jobs:
506      - macos-arm-libssh2
507
508  macos-arm-libssh-c-ares:
509    jobs:
510      - macos-arm-libssh-c-ares
511
512  macos-arm-libssh:
513    jobs:
514      - macos-arm-libssh
515
516  macos-arm-c-ares:
517    jobs:
518      - macos-arm-c-ares
519
520  macos-arm-http-only:
521    jobs:
522      - macos-arm-http-only
523
524  macos-arm-http-securetransport-http2:
525    jobs:
526      - macos-arm-http-securetransport-http2
527
528  macos-arm-http-openssl-http2:
529    jobs:
530      - macos-arm-http-openssl-http2
531
532  # There are problem linking with LibreSSL on the CI boxes that prevent this
533  # from working.
534  # macos-arm-http-libressl-http2:
535  #   jobs:
536  #     - macos-arm-http-libressl-http2
537
538  macos-arm-http-torture:
539    jobs:
540      - macos-arm-http-torture
541
542  macos-arm-http-torture-ftp:
543    jobs:
544      - macos-arm-http-torture-ftp
545