• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
2#
3# SPDX-License-Identifier: curl
4
5name: macOS
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.yml'
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.yml'
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
42env:
43  DEVELOPER_DIR: /Applications/Xcode_14.0.1.app/Contents/Developer
44
45jobs:
46  autotools:
47    name: ${{ matrix.build.name }}
48    runs-on: 'macos-latest'
49    timeout-minutes: 90
50    strategy:
51      fail-fast: false
52      matrix:
53        build:
54        - name: normal
55          install: nghttp2
56          configure: --without-ssl
57          macosx-version-min: 10.9
58        - name: debug
59          install: nghttp2
60          configure: --enable-debug --without-ssl
61          macosx-version-min: 10.9
62        - name: libssh2
63          install: nghttp2 libssh2
64          configure: --enable-debug --with-libssh2 --without-ssl
65          macosx-version-min: 10.9
66        - name: libssh-c-ares
67          install: openssl nghttp2 libssh
68          configure: --enable-debug --with-libssh --with-openssl=/usr/local/opt/openssl --enable-ares
69          macosx-version-min: 10.9
70        - name: libssh
71          install: openssl nghttp2 libssh
72          configure: --enable-debug --with-libssh --with-openssl=/usr/local/opt/openssl
73          macosx-version-min: 10.9
74        - name: c-ares
75          install: nghttp2
76          configure: --enable-debug --enable-ares --without-ssl
77          macosx-version-min: 10.9
78        - name: HTTP only
79          install: nghttp2
80          configure: --enable-debug --enable-maintainer-mode --disable-dict --disable-file --disable-ftp --disable-gopher --disable-imap --disable-ldap --disable-pop3 --disable-rtmp --disable-rtsp --disable-scp --disable-sftp --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-ntlm-auth --without-ssl --without-zlib
81          macosx-version-min: 10.15
82        - name: SecureTransport http2
83          install: nghttp2
84          configure: --enable-debug --with-secure-transport
85          macosx-version-min: 10.8
86        - name: OpenSSL http2
87          install: nghttp2 openssl
88          configure: --enable-debug --with-openssl=/usr/local/opt/openssl
89          macosx-version-min: 10.9
90        - name: LibreSSL http2
91          install: nghttp2 libressl
92          configure: --enable-debug --with-openssl=/usr/local/opt/libressl
93          macosx-version-min: 10.9
94        - name: torture
95          install: nghttp2 openssl
96          configure: --enable-debug --disable-shared --disable-threaded-resolver --with-openssl=/usr/local/opt/openssl
97          tflags: -n -t --shallow=25 !FTP
98          macosx-version-min: 10.9
99        - name: torture-ftp
100          install: nghttp2 openssl
101          configure: --enable-debug --disable-shared --disable-threaded-resolver --with-openssl=/usr/local/opt/openssl
102          tflags: -n -t --shallow=20 FTP
103          macosx-version-min: 10.9
104        - name: macOS 10.15
105          install: nghttp2 libssh2 openssl
106          configure: --enable-debug --disable-ldap --with-openssl=/usr/local/opt/openssl
107          macosx-version-min: 10.15
108    steps:
109    - run: echo libtool autoconf automake pkg-config ${{ matrix.build.install }} | xargs -Ix -n1 echo brew '"x"' > /tmp/Brewfile
110      name: 'brew bundle'
111
112    # Run this command with retries because of spurious failures seen
113    # while running the tests, for example
114    # https://github.com/curl/curl/runs/4095721123?check_suite_focus=true
115    - run: "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; false; } done; false Too many retries; done"
116      name: 'brew install'
117
118    - run: python3 -m pip install impacket
119      name: 'pip3 install'
120
121    - uses: actions/checkout@v3
122
123    - run: autoreconf -fi
124      name: 'autoreconf'
125
126    - run: ./configure --enable-warnings --enable-werror ${{ matrix.build.configure }}  --enable-websockets
127      name: 'configure'
128      env:
129        # -Wvla is caused by brotli
130        CFLAGS: "-Wno-vla -mmacosx-version-min=${{ matrix.build.macosx-version-min }}"
131
132    - run: make V=1
133      name: 'make'
134
135    - run: make V=1 examples
136      name: 'make examples'
137
138    - run: make V=1 -C tests
139      name: 'make tests'
140
141    - run: make V=1 test-ci
142      name: 'run tests'
143      env:
144        TFLAGS: "${{ matrix.build.tflags }} ~1452"
145
146  cmake:
147    name: cmake ${{ matrix.compiler.CC }} ${{ matrix.build.name }}
148    runs-on: 'macos-latest'
149    env: ${{ matrix.compiler }}
150    strategy:
151      fail-fast: false
152      matrix:
153        compiler:
154        - CC: clang
155          CXX: clang++
156          CFLAGS: "-mmacosx-version-min=10.15 -Wno-deprecated-declarations"
157        - CC: gcc-12
158          CXX: g++-12
159          CFLAGS: "-mmacosx-version-min=10.15 -Wno-error=undef -Wno-error=conversion"
160        build:
161        - name: OpenSSL
162          install: nghttp2 openssl
163          generate: -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -DCURL_DISABLE_LDAP=ON -DCURL_DISABLE_LDAPS=ON
164        - name: LibreSSL
165          install: nghttp2 libressl
166          generate: -DOPENSSL_ROOT_DIR=/usr/local/opt/libressl -DCURL_DISABLE_LDAP=ON -DCURL_DISABLE_LDAPS=ON
167        - name: libssh2
168          install: nghttp2 openssl libssh2
169          generate: -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -DCURL_USE_LIBSSH2=ON
170    steps:
171    - run: echo libtool autoconf automake pkg-config ${{ matrix.build.install }} | xargs -Ix -n1 echo brew '"x"' > /tmp/Brewfile
172      name: 'brew bundle'
173
174    - run: "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; false; } done; false Too many retries; done"
175      name: 'brew install'
176
177    - run: python3 -m pip install impacket
178      name: 'pip3 install'
179
180    - uses: actions/checkout@v3
181
182    - run: cmake -S. -Bbuild -DCURL_WERROR=ON -DPICKY_COMPILER=ON ${{ matrix.build.generate }}
183      name: 'cmake generate'
184
185    - run: cmake --build build
186      name: 'cmake build'
187