GHA: tidy up parallel options, improve performance for some jobs

- replace `--parallel <n>` and `-j<n>` for individual commands with
  `MAKEFLAGS`, for jobs not yet doing it.
  This enables parallel builds in distcheck / maketgz-and-verify-in-tree,
  where `-j` option was missing.
- add `--parallel` for iOS Xcode job for improved performance.
- drop redundant `-j5` for Android jobs.
- drop stray `cmake --config` options from single-target jobs (cygwin,
  msys/mingw, dl-mingw, non-native). Drop redundant
  `CMAKE_RUNTIME_OUTPUT_DIRECTORY_*` settings too.
- GHA/windows: add timeout for package install steps where missing.
- GHA/non-native: specify target type explicitly for iOS cmake jobs.
  Xcode default was already Debug, single-target default was generic,
  now it's Release, with unity batch to keep it fast.

`MAKEFLAGS` is necessary for autotools jobs and CMake jobs using
the default (GNU Make) generator. It's ignored by Ninja and other tools.
`cmake --parallel` is still necessary for jobs with Visual Studio or
Xcode generators. Parallelism is 5 for GHA Linux and Windows runners,
4 for macOS, 3 for VMs, 2 for AppVeyor.

Closes #16502
This commit is contained in:
Viktor Szakats 2025-02-26 21:40:59 +01:00
parent bc24c60512
commit 08a29e7f18
No known key found for this signature in database
GPG Key ID: B5ABD165E2AEF201
4 changed files with 92 additions and 78 deletions

View File

@ -19,6 +19,9 @@ concurrency:
permissions: {} permissions: {}
env:
MAKEFLAGS: -j 5
jobs: jobs:
maketgz-and-verify-in-tree: maketgz-and-verify-in-tree:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -55,9 +58,9 @@ jobs:
tar xvf curl-99.98.97.tar.gz tar xvf curl-99.98.97.tar.gz
pushd curl-99.98.97 pushd curl-99.98.97
./configure --prefix=$HOME/temp --without-ssl --without-libpsl ./configure --prefix=$HOME/temp --without-ssl --without-libpsl
make -j5 make
make -j5 test-ci make test-ci
make -j5 install make install
popd popd
# basic check of the installed files # basic check of the installed files
bash scripts/installcheck.sh $HOME/temp bash scripts/installcheck.sh $HOME/temp
@ -80,8 +83,8 @@ jobs:
mkdir build mkdir build
pushd build pushd build
../curl-99.98.97/configure --without-ssl --without-libpsl ../curl-99.98.97/configure --without-ssl --without-libpsl
make -j5 make
make -j5 test-ci make test-ci
popd popd
rm -rf build rm -rf build
rm -rf curl-99.98.97 rm -rf curl-99.98.97
@ -103,9 +106,9 @@ jobs:
mkdir build mkdir build
pushd build pushd build
../configure --without-ssl --enable-debug "--prefix=${PWD}/pkg" --without-libpsl ../configure --without-ssl --enable-debug "--prefix=${PWD}/pkg" --without-libpsl
make -j5 make
make -j5 test-ci make test-ci
make -j5 install make install
verify-out-of-tree-cmake: verify-out-of-tree-cmake:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -122,7 +125,7 @@ jobs:
tar xvf curl-99.98.97.tar.gz tar xvf curl-99.98.97.tar.gz
pushd curl-99.98.97 pushd curl-99.98.97
cmake -B build -DCURL_WERROR=ON -DCURL_USE_LIBPSL=OFF cmake -B build -DCURL_WERROR=ON -DCURL_USE_LIBPSL=OFF
make -C build -j5 make -C build
missing-files: missing-files:
runs-on: ubuntu-latest runs-on: ubuntu-latest

View File

@ -47,8 +47,8 @@ permissions: {}
# newer than the 10.8 required by `CFURLCreateDataAndPropertiesFromResource`. # newer than the 10.8 required by `CFURLCreateDataAndPropertiesFromResource`.
env: env:
LDFLAGS: -w # suppress 'object file was built for newer macOS version than being linked' warnings
MAKEFLAGS: -j 4 MAKEFLAGS: -j 4
LDFLAGS: -w # suppress 'object file was built for newer macOS version than being linked' warnings
jobs: jobs:
macos: macos:

View File

@ -59,21 +59,21 @@ jobs:
time cmake -B bld -G Ninja \ time cmake -B bld -G Ninja \
-DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \ -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \
-DCURL_WERROR=ON \ -DCURL_WERROR=ON \
-DENABLE_DEBUG=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG= \ -DENABLE_DEBUG=ON -DCMAKE_BUILD_TYPE=Debug \
-DCURL_USE_OPENSSL=ON \ -DCURL_USE_OPENSSL=ON \
-DCURL_USE_GSSAPI=ON \ -DCURL_USE_GSSAPI=ON \
|| { cat bld/CMakeFiles/CMake*.yaml; false; } || { cat bld/CMakeFiles/CMake*.yaml; false; }
echo '::group::curl_config.h (raw)'; cat bld/lib/curl_config.h || true; echo '::endgroup::' echo '::group::curl_config.h (raw)'; cat bld/lib/curl_config.h || true; echo '::endgroup::'
echo '::group::curl_config.h'; grep -F '#define' bld/lib/curl_config.h | sort || true; echo '::endgroup::' echo '::group::curl_config.h'; grep -F '#define' bld/lib/curl_config.h | sort || true; echo '::endgroup::'
time cmake --build bld --config Debug time cmake --build bld
bld/src/curl --disable --version bld/src/curl --disable --version
if [ '${{ matrix.arch }}' = 'x86_64' ]; then # Slow on emulated CPU if [ '${{ matrix.arch }}' = 'x86_64' ]; then # Slow on emulated CPU
time cmake --build bld --config Debug --target testdeps time cmake --build bld --target testdeps
export TFLAGS='-j4' export TFLAGS='-j4'
time cmake --build bld --config Debug --target test-ci time cmake --build bld --target test-ci
fi fi
echo '::group::build examples' echo '::group::build examples'
time cmake --build bld --config Debug --target curl-examples time cmake --build bld --target curl-examples
echo '::endgroup::' echo '::endgroup::'
openbsd: openbsd:
@ -100,20 +100,20 @@ jobs:
time cmake -B bld -G Ninja \ time cmake -B bld -G Ninja \
-DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \ -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \
-DCURL_WERROR=ON \ -DCURL_WERROR=ON \
-DENABLE_DEBUG=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG= \ -DENABLE_DEBUG=ON -DCMAKE_BUILD_TYPE=Debug \
-DCURL_USE_OPENSSL=ON \ -DCURL_USE_OPENSSL=ON \
|| { cat bld/CMakeFiles/CMake*.yaml; false; } || { cat bld/CMakeFiles/CMake*.yaml; false; }
echo '::group::curl_config.h (raw)'; cat bld/lib/curl_config.h || true; echo '::endgroup::' echo '::group::curl_config.h (raw)'; cat bld/lib/curl_config.h || true; echo '::endgroup::'
echo '::group::curl_config.h'; grep -F '#define' bld/lib/curl_config.h | sort || true; echo '::endgroup::' echo '::group::curl_config.h'; grep -F '#define' bld/lib/curl_config.h | sort || true; echo '::endgroup::'
time cmake --build bld --config Debug time cmake --build bld
bld/src/curl --disable --version bld/src/curl --disable --version
if [ '${{ matrix.arch }}' = 'x86_64' ]; then # Slow on emulated CPU if [ '${{ matrix.arch }}' = 'x86_64' ]; then # Slow on emulated CPU
time cmake --build bld --config Debug --target testdeps time cmake --build bld --target testdeps
export TFLAGS='-j8 ~3017 ~TFTP ~FTP' # FIXME: TFTP requests executed twice? Related: `curl: (69) TFTP: Access Violation`? export TFLAGS='-j8 ~3017 ~TFTP ~FTP' # FIXME: TFTP requests executed twice? Related: `curl: (69) TFTP: Access Violation`?
time cmake --build bld --config Debug --target test-ci time cmake --build bld --target test-ci
fi fi
echo '::group::build examples' echo '::group::build examples'
time cmake --build bld --config Debug --target curl-examples time cmake --build bld --target curl-examples
echo '::endgroup::' echo '::endgroup::'
freebsd: freebsd:
@ -140,6 +140,7 @@ jobs:
version: '14.1' version: '14.1'
architecture: ${{ matrix.arch }} architecture: ${{ matrix.arch }}
run: | run: |
export MAKEFLAGS=-j3
# https://ports.freebsd.org/ # https://ports.freebsd.org/
time sudo pkg install -y autoconf automake libtool \ time sudo pkg install -y autoconf automake libtool \
pkgconf brotli openldap26-client libidn2 libnghttp2 stunnel py311-impacket pkgconf brotli openldap26-client libidn2 libnghttp2 stunnel py311-impacket
@ -154,18 +155,18 @@ jobs:
|| { tail -n 1000 config.log; false; } || { tail -n 1000 config.log; false; }
echo '::group::curl_config.h (raw)'; cat lib/curl_config.h || true; echo '::endgroup::' echo '::group::curl_config.h (raw)'; cat lib/curl_config.h || true; echo '::endgroup::'
echo '::group::curl_config.h'; grep -F '#define' lib/curl_config.h | sort || true; echo '::endgroup::' echo '::group::curl_config.h'; grep -F '#define' lib/curl_config.h | sort || true; echo '::endgroup::'
time make -j3 install time make install
src/curl --disable --version src/curl --disable --version
desc='${{ matrix.desc }}' desc='${{ matrix.desc }}'
if [ '${{ matrix.arch }}' = 'x86_64' ]; then # Slow on emulated CPU if [ '${{ matrix.arch }}' = 'x86_64' ]; then # Slow on emulated CPU
time make -j3 -C tests time make -C tests
if [ "${desc#*!runtests*}" = "${desc}" ]; then if [ "${desc#*!runtests*}" = "${desc}" ]; then
time make test-ci V=1 TFLAGS='-j4' time make test-ci V=1 TFLAGS='-j4'
fi fi
fi fi
if [ "${desc#*!examples*}" = "${desc}" ]; then if [ "${desc#*!examples*}" = "${desc}" ]; then
echo '::group::build examples' echo '::group::build examples'
time make -j3 examples time make examples
echo '::endgroup::' echo '::endgroup::'
fi fi
@ -184,25 +185,25 @@ jobs:
-DCMAKE_C_COMPILER='${{ matrix.compiler }}' \ -DCMAKE_C_COMPILER='${{ matrix.compiler }}' \
-DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \ -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \
-DCURL_WERROR=ON \ -DCURL_WERROR=ON \
-DENABLE_DEBUG=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG= \ -DENABLE_DEBUG=ON -DCMAKE_BUILD_TYPE=Debug \
-DCURL_USE_OPENSSL=ON \ -DCURL_USE_OPENSSL=ON \
-DCURL_USE_GSSAPI=ON \ -DCURL_USE_GSSAPI=ON \
${{ matrix.options }} \ ${{ matrix.options }} \
|| { cat bld/CMakeFiles/CMake*.yaml; false; } || { cat bld/CMakeFiles/CMake*.yaml; false; }
echo '::group::curl_config.h (raw)'; cat bld/lib/curl_config.h || true; echo '::endgroup::' echo '::group::curl_config.h (raw)'; cat bld/lib/curl_config.h || true; echo '::endgroup::'
echo '::group::curl_config.h'; grep -F '#define' bld/lib/curl_config.h | sort || true; echo '::endgroup::' echo '::group::curl_config.h'; grep -F '#define' bld/lib/curl_config.h | sort || true; echo '::endgroup::'
time cmake --build bld --config Debug time cmake --build bld
bld/src/curl --disable --version bld/src/curl --disable --version
desc='${{ matrix.desc }}' desc='${{ matrix.desc }}'
if [ '${{ matrix.arch }}' = 'x86_64' ]; then # Slow on emulated CPU if [ '${{ matrix.arch }}' = 'x86_64' ]; then # Slow on emulated CPU
time cmake --build bld --config Debug --target testdeps time cmake --build bld --target testdeps
if [ "${desc#*!runtests*}" = "${desc}" ]; then if [ "${desc#*!runtests*}" = "${desc}" ]; then
time cmake --build bld --config Debug --target test-ci time cmake --build bld --target test-ci
fi fi
fi fi
if [ "${desc#*!examples*}" = "${desc}" ]; then if [ "${desc#*!examples*}" = "${desc}" ]; then
echo '::group::build examples' echo '::group::build examples'
time cmake --build bld --config Debug --target curl-examples time cmake --build bld --target curl-examples
echo '::endgroup::' echo '::endgroup::'
fi fi
@ -223,6 +224,7 @@ jobs:
run: | run: |
set -e set -e
ln -s /usr/bin/gcpp /usr/bin/cpp # Some tests expect `cpp`, which is named `gcpp` in this env. ln -s /usr/bin/gcpp /usr/bin/cpp # Some tests expect `cpp`, which is named `gcpp` in this env.
export MAKEFLAGS=-j3
time autoreconf -fi time autoreconf -fi
mkdir bld && cd bld && time ../configure --enable-unity --enable-test-bundles --enable-debug --enable-warnings --enable-werror \ mkdir bld && cd bld && time ../configure --enable-unity --enable-test-bundles --enable-debug --enable-warnings --enable-werror \
--prefix="${HOME}"/install \ --prefix="${HOME}"/install \
@ -231,12 +233,12 @@ jobs:
|| { tail -n 1000 config.log; false; } || { tail -n 1000 config.log; false; }
echo '::group::curl_config.h (raw)'; cat lib/curl_config.h || true; echo '::endgroup::' echo '::group::curl_config.h (raw)'; cat lib/curl_config.h || true; echo '::endgroup::'
echo '::group::curl_config.h'; grep -F '#define' lib/curl_config.h | sort || true; echo '::endgroup::' echo '::group::curl_config.h'; grep -F '#define' lib/curl_config.h | sort || true; echo '::endgroup::'
time gmake -j3 install time gmake install
src/curl --disable --version src/curl --disable --version
time gmake -j3 -C tests time gmake -C tests
time gmake test-ci V=1 time gmake test-ci V=1
echo '::group::build examples' echo '::group::build examples'
time gmake -j3 examples time gmake examples
echo '::endgroup::' echo '::endgroup::'
ios: ios:
@ -244,9 +246,9 @@ jobs:
runs-on: 'macos-latest' runs-on: 'macos-latest'
timeout-minutes: 10 timeout-minutes: 10
env: env:
MAKEFLAGS: -j 4
DEVELOPER_DIR: "/Applications/Xcode${{ matrix.build.xcode && format('_{0}', matrix.build.xcode) || '' }}.app/Contents/Developer" DEVELOPER_DIR: "/Applications/Xcode${{ matrix.build.xcode && format('_{0}', matrix.build.xcode) || '' }}.app/Contents/Developer"
CC: ${{ matrix.build.compiler || 'clang' }} CC: ${{ matrix.build.compiler || 'clang' }}
MAKEFLAGS: -j 4
# renovate: datasource=github-tags depName=libressl-portable/portable versioning=semver registryUrl=https://github.com # renovate: datasource=github-tags depName=libressl-portable/portable versioning=semver registryUrl=https://github.com
libressl-version: 4.0.0 libressl-version: 4.0.0
strategy: strategy:
@ -261,6 +263,7 @@ jobs:
install_steps: libressl install_steps: libressl
# FIXME: Could not make OPENSSL_ROOT_DIR work. CMake seems to prepend sysroot to it. # FIXME: Could not make OPENSSL_ROOT_DIR work. CMake seems to prepend sysroot to it.
generate: >- generate: >-
-DCMAKE_BUILD_TYPE=Release -DCMAKE_UNITY_BUILD_BATCH_SIZE=50
-DOPENSSL_INCLUDE_DIR="$HOME/libressl/include" -DOPENSSL_INCLUDE_DIR="$HOME/libressl/include"
-DOPENSSL_SSL_LIBRARY="$HOME/libressl/lib/libssl.a" -DOPENSSL_SSL_LIBRARY="$HOME/libressl/lib/libssl.a"
-DOPENSSL_CRYPTO_LIBRARY="$HOME/libressl/lib/libcrypto.a" -DOPENSSL_CRYPTO_LIBRARY="$HOME/libressl/lib/libcrypto.a"
@ -269,6 +272,7 @@ jobs:
- name: 'libressl' - name: 'libressl'
install_steps: libressl install_steps: libressl
generator: Xcode generator: Xcode
options: --config Debug
generate: >- generate: >-
-DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED=OFF -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED=OFF
-DMACOSX_BUNDLE_GUI_IDENTIFIER=se.curl -DMACOSX_BUNDLE_GUI_IDENTIFIER=se.curl
@ -361,7 +365,7 @@ jobs:
- name: 'build' - name: 'build'
run: | run: |
if [ -n '${{ matrix.build.generate }}' ]; then if [ -n '${{ matrix.build.generate }}' ]; then
cmake --build bld --verbose cmake --build bld ${{ matrix.build.options }} --parallel 4 --verbose
else else
make -C bld V=1 make -C bld V=1
fi fi
@ -372,7 +376,7 @@ jobs:
- name: 'build tests' - name: 'build tests'
run: | run: |
if [ -n '${{ matrix.build.generate }}' ]; then if [ -n '${{ matrix.build.generate }}' ]; then
cmake --build bld --target testdeps --verbose cmake --build bld ${{ matrix.build.options }} --parallel 4 --target testdeps --verbose
else else
make -C bld V=1 -C tests make -C bld V=1 -C tests
fi fi
@ -380,7 +384,7 @@ jobs:
- name: 'build examples' - name: 'build examples'
run: | run: |
if [ -n '${{ matrix.build.generate }}' ]; then if [ -n '${{ matrix.build.generate }}' ]; then
cmake --build bld --target curl-examples --verbose cmake --build bld ${{ matrix.build.options }} --parallel 4 --target curl-examples --verbose
else else
make -C bld examples V=1 make -C bld examples V=1
fi fi
@ -390,9 +394,9 @@ jobs:
runs-on: 'ubuntu-latest' runs-on: 'ubuntu-latest'
timeout-minutes: 25 timeout-minutes: 25
env: env:
MAKEFLAGS: -j 5
VCPKG_BINARY_SOURCES: 'clear;x-gha,readwrite' VCPKG_BINARY_SOURCES: 'clear;x-gha,readwrite'
VCPKG_DISABLE_METRICS: '1' VCPKG_DISABLE_METRICS: '1'
MAKEFLAGS: -j 5
strategy: strategy:
matrix: matrix:
include: include:
@ -490,7 +494,7 @@ jobs:
if [ '${{ matrix.build }}' = 'cmake' ]; then if [ '${{ matrix.build }}' = 'cmake' ]; then
cmake --build bld --verbose cmake --build bld --verbose
else else
make -j5 -C bld V=1 make -C bld V=1
fi fi
- name: 'curl info' - name: 'curl info'
@ -501,7 +505,7 @@ jobs:
if [ '${{ matrix.build }}' = 'cmake' ]; then if [ '${{ matrix.build }}' = 'cmake' ]; then
cmake --build bld --target testdeps cmake --build bld --target testdeps
else else
make -j5 -C bld -C tests make -C bld -C tests
fi fi
- name: 'build examples' - name: 'build examples'
@ -509,7 +513,7 @@ jobs:
if [ '${{ matrix.build }}' = 'cmake' ]; then if [ '${{ matrix.build }}' = 'cmake' ]; then
cmake --build bld --target curl-examples cmake --build bld --target curl-examples
else else
make -j5 -C bld examples make -C bld examples
fi fi
amiga: amiga:
@ -517,6 +521,7 @@ jobs:
runs-on: 'ubuntu-latest' runs-on: 'ubuntu-latest'
timeout-minutes: 5 timeout-minutes: 5
env: env:
MAKEFLAGS: -j 5
amissl-version: 5.18 amissl-version: 5.18
strategy: strategy:
matrix: matrix:
@ -584,9 +589,9 @@ jobs:
- name: 'build' - name: 'build'
run: | run: |
if [ '${{ matrix.build }}' = 'cmake' ]; then if [ '${{ matrix.build }}' = 'cmake' ]; then
cmake --build bld --parallel 5 cmake --build bld
else else
make -j5 -C bld make -C bld
fi fi
- name: 'curl info' - name: 'curl info'
@ -596,18 +601,18 @@ jobs:
if: ${{ matrix.build == 'cmake' }} # skip for autotools to save time if: ${{ matrix.build == 'cmake' }} # skip for autotools to save time
run: | run: |
if [ '${{ matrix.build }}' = 'cmake' ]; then if [ '${{ matrix.build }}' = 'cmake' ]; then
cmake --build bld --parallel 5 --target testdeps cmake --build bld --target testdeps
else else
make -j5 -C bld -C tests make -C bld -C tests
fi fi
- name: 'build examples' - name: 'build examples'
if: ${{ matrix.build == 'cmake' }} # skip for autotools to save time if: ${{ matrix.build == 'cmake' }} # skip for autotools to save time
run: | run: |
if [ '${{ matrix.build }}' = 'cmake' ]; then if [ '${{ matrix.build }}' = 'cmake' ]; then
cmake --build bld --parallel 5 --target curl-examples cmake --build bld --target curl-examples
else else
make -j5 -C bld examples make -C bld examples
fi fi
msdos: msdos:
@ -615,6 +620,7 @@ jobs:
runs-on: 'ubuntu-latest' runs-on: 'ubuntu-latest'
timeout-minutes: 5 timeout-minutes: 5
env: env:
MAKEFLAGS: -j 5
toolchain-version: '3.4' toolchain-version: '3.4'
strategy: strategy:
matrix: matrix:
@ -694,7 +700,7 @@ jobs:
if [ '${{ matrix.build }}' = 'cmake' ]; then if [ '${{ matrix.build }}' = 'cmake' ]; then
cmake --build bld cmake --build bld
else else
make -j5 -C bld make -C bld
fi fi
- name: 'curl info' - name: 'curl info'
@ -706,7 +712,7 @@ jobs:
if [ '${{ matrix.build }}' = 'cmake' ]; then if [ '${{ matrix.build }}' = 'cmake' ]; then
cmake --build bld --target testdeps cmake --build bld --target testdeps
else else
make -j5 -C bld -C tests make -C bld -C tests
fi fi
- name: 'build examples' - name: 'build examples'
@ -715,5 +721,5 @@ jobs:
if [ '${{ matrix.build }}' = 'cmake' ]; then if [ '${{ matrix.build }}' = 'cmake' ]; then
cmake --build bld --target curl-examples cmake --build bld --target curl-examples
else else
make -j5 -C bld examples make -C bld examples
fi fi

View File

@ -44,6 +44,7 @@ jobs:
run: run:
shell: C:\cygwin\bin\bash.exe '{0}' shell: C:\cygwin\bin\bash.exe '{0}'
env: env:
MAKEFLAGS: -j 5
SHELLOPTS: 'igncr' SHELLOPTS: 'igncr'
strategy: strategy:
matrix: matrix:
@ -111,9 +112,9 @@ jobs:
timeout-minutes: 10 timeout-minutes: 10
run: | run: |
if [ '${{ matrix.build }}' = 'cmake' ]; then if [ '${{ matrix.build }}' = 'cmake' ]; then
cmake --build bld --config '${{ matrix.type }}' cmake --build bld
else else
make -C bld -j5 V=1 install make -C bld V=1 install
fi fi
- name: 'curl version' - name: 'curl version'
@ -130,9 +131,9 @@ jobs:
timeout-minutes: 15 timeout-minutes: 15
run: | run: |
if [ '${{ matrix.build }}' = 'cmake' ]; then if [ '${{ matrix.build }}' = 'cmake' ]; then
cmake --build bld --config '${{ matrix.type }}' --target testdeps cmake --build bld --target testdeps
else else
make -C bld -j5 V=1 -C tests make -C bld V=1 -C tests
fi fi
- name: 'run tests' - name: 'run tests'
@ -145,9 +146,9 @@ jobs:
fi fi
if [ '${{ matrix.build }}' = 'cmake' ]; then if [ '${{ matrix.build }}' = 'cmake' ]; then
PATH="$PWD/bld/lib:$PATH" PATH="$PWD/bld/lib:$PATH"
cmake --build bld --config '${{ matrix.type }}' --target test-ci cmake --build bld --target test-ci
else else
make -C bld -j5 V=1 test-ci make -C bld V=1 test-ci
fi fi
- name: 'build examples' - name: 'build examples'
@ -155,9 +156,9 @@ jobs:
timeout-minutes: 5 timeout-minutes: 5
run: | run: |
if [ '${{ matrix.build }}' = 'cmake' ]; then if [ '${{ matrix.build }}' = 'cmake' ]; then
cmake --build bld --config '${{ matrix.type }}' --target curl-examples cmake --build bld --target curl-examples
else else
make -C bld -j5 V=1 examples make -C bld V=1 examples
fi fi
msys2: # both msys and mingw-w64 msys2: # both msys and mingw-w64
@ -167,6 +168,8 @@ jobs:
defaults: defaults:
run: run:
shell: msys2 {0} shell: msys2 {0}
env:
MAKEFLAGS: -j 5
strategy: strategy:
matrix: matrix:
include: include:
@ -250,8 +253,6 @@ jobs:
fi fi
[ '${{ matrix.sys }}' = 'msys' ] && options+=' -D_CURL_PREFILL=ON' [ '${{ matrix.sys }}' = 'msys' ] && options+=' -D_CURL_PREFILL=ON'
[ '${{ matrix.test }}' = 'uwp' ] && options+=' -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0' [ '${{ matrix.test }}' = 'uwp' ] && options+=' -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0'
[ '${{ matrix.type }}' = 'Debug' ] && options+=' -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG='
[ '${{ matrix.type }}' = 'Release' ] && options+=' -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE='
[ "${_chkprefill}" = '_chkprefill' ] && options+=' -D_CURL_PREFILL=OFF' [ "${_chkprefill}" = '_chkprefill' ] && options+=' -D_CURL_PREFILL=OFF'
cmake -B "bld${_chkprefill}" -G Ninja ${options} \ cmake -B "bld${_chkprefill}" -G Ninja ${options} \
-DCMAKE_C_FLAGS="${{ matrix.cflags }} ${CFLAGS_CMAKE} ${CPPFLAGS}" \ -DCMAKE_C_FLAGS="${{ matrix.cflags }} ${CFLAGS_CMAKE} ${CPPFLAGS}" \
@ -286,9 +287,9 @@ jobs:
timeout-minutes: 10 timeout-minutes: 10
run: | run: |
if [ '${{ matrix.build }}' = 'cmake' ]; then if [ '${{ matrix.build }}' = 'cmake' ]; then
cmake --build bld --config '${{ matrix.type }}' cmake --build bld
else else
make -C bld -j5 V=1 install make -C bld V=1 install
fi fi
- name: 'curl version' - name: 'curl version'
@ -311,9 +312,9 @@ jobs:
timeout-minutes: 10 timeout-minutes: 10
run: | run: |
if [ '${{ matrix.build }}' = 'cmake' ]; then if [ '${{ matrix.build }}' = 'cmake' ]; then
cmake --build bld --config '${{ matrix.type }}' --target testdeps cmake --build bld --target testdeps
else else
make -C bld -j5 V=1 -C tests make -C bld V=1 -C tests
fi fi
if [ '${{ matrix.build }}' != 'cmake' ]; then if [ '${{ matrix.build }}' != 'cmake' ]; then
# avoid libtool's .exe wrappers # avoid libtool's .exe wrappers
@ -347,10 +348,10 @@ jobs:
PATH="$PATH:/c/Program Files (x86)/stunnel/bin" PATH="$PATH:/c/Program Files (x86)/stunnel/bin"
if [ '${{ matrix.build }}' = 'cmake' ]; then if [ '${{ matrix.build }}' = 'cmake' ]; then
PATH="$PWD/bld/lib:$PATH" PATH="$PWD/bld/lib:$PATH"
cmake --build bld --config '${{ matrix.type }}' --target test-ci cmake --build bld --target test-ci
else else
PATH="$PWD/bld/lib/.libs:$PATH" PATH="$PWD/bld/lib/.libs:$PATH"
make -C bld -j5 V=1 test-ci make -C bld V=1 test-ci
fi fi
- name: 'build examples' - name: 'build examples'
@ -358,9 +359,9 @@ jobs:
timeout-minutes: 5 timeout-minutes: 5
run: | run: |
if [ '${{ matrix.build }}' = 'cmake' ]; then if [ '${{ matrix.build }}' = 'cmake' ]; then
cmake --build bld --config '${{ matrix.type }}' --target curl-examples cmake --build bld --target curl-examples
else else
make -C bld -j5 V=1 examples make -C bld V=1 examples
fi fi
mingw-w64-standalone-downloads: mingw-w64-standalone-downloads:
@ -370,6 +371,8 @@ jobs:
defaults: defaults:
run: run:
shell: C:\msys64\usr\bin\bash.exe {0} shell: C:\msys64\usr\bin\bash.exe {0}
env:
MAKEFLAGS: -j 5
strategy: strategy:
matrix: matrix:
include: include:
@ -428,8 +431,6 @@ jobs:
PATH="$(cygpath "${USERPROFILE}")/my-cache/${{ matrix.dir }}/bin:/c/msys64/usr/bin:$PATH" PATH="$(cygpath "${USERPROFILE}")/my-cache/${{ matrix.dir }}/bin:/c/msys64/usr/bin:$PATH"
for _chkprefill in '' ${{ matrix.chkprefill }}; do for _chkprefill in '' ${{ matrix.chkprefill }}; do
options='' options=''
[ '${{ matrix.type }}' = 'Debug' ] && options+=' -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG='
[ '${{ matrix.type }}' = 'Release' ] && options+=' -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE='
[ "${_chkprefill}" = '_chkprefill' ] && options+=' -D_CURL_PREFILL=OFF' [ "${_chkprefill}" = '_chkprefill' ] && options+=' -D_CURL_PREFILL=OFF'
cmake -B "bld${_chkprefill}" -G 'MSYS Makefiles' ${options} \ cmake -B "bld${_chkprefill}" -G 'MSYS Makefiles' ${options} \
-DCMAKE_C_COMPILER=gcc \ -DCMAKE_C_COMPILER=gcc \
@ -457,7 +458,7 @@ jobs:
timeout-minutes: 5 timeout-minutes: 5
run: | run: |
PATH="$(cygpath "${USERPROFILE}")/my-cache/${{ matrix.dir }}/bin:/c/msys64/usr/bin:$PATH" PATH="$(cygpath "${USERPROFILE}")/my-cache/${{ matrix.dir }}/bin:/c/msys64/usr/bin:$PATH"
cmake --build bld --config '${{ matrix.type }}' --parallel 5 cmake --build bld
- name: 'curl version' - name: 'curl version'
timeout-minutes: 1 timeout-minutes: 1
@ -471,7 +472,7 @@ jobs:
timeout-minutes: 10 timeout-minutes: 10
run: | run: |
PATH="$(cygpath "${USERPROFILE}")/my-cache/${{ matrix.dir }}/bin:/c/msys64/usr/bin:$PATH" PATH="$(cygpath "${USERPROFILE}")/my-cache/${{ matrix.dir }}/bin:/c/msys64/usr/bin:$PATH"
cmake --build bld --config '${{ matrix.type }}' --parallel 5 --target testdeps cmake --build bld --target testdeps
- name: 'install test prereqs' - name: 'install test prereqs'
if: ${{ matrix.tflags != 'skipall' && matrix.tflags != 'skiprun' }} if: ${{ matrix.tflags != 'skipall' && matrix.tflags != 'skiprun' }}
@ -500,27 +501,29 @@ jobs:
TFLAGS+=" -ac $(cygpath "${SYSTEMROOT}/System32/curl.exe")" TFLAGS+=" -ac $(cygpath "${SYSTEMROOT}/System32/curl.exe")"
fi fi
PATH="$PWD/bld/lib:$PATH:/c/Program Files (x86)/stunnel/bin" PATH="$PWD/bld/lib:$PATH:/c/Program Files (x86)/stunnel/bin"
cmake --build bld --config '${{ matrix.type }}' --target test-ci cmake --build bld --target test-ci
- name: 'build examples' - name: 'build examples'
timeout-minutes: 5 timeout-minutes: 5
run: | run: |
PATH="$(cygpath "${USERPROFILE}")/my-cache/${{ matrix.dir }}/bin:/c/msys64/usr/bin:$PATH" PATH="$(cygpath "${USERPROFILE}")/my-cache/${{ matrix.dir }}/bin:/c/msys64/usr/bin:$PATH"
cmake --build bld --config '${{ matrix.type }}' --parallel 5 --target curl-examples cmake --build bld --target curl-examples
linux-cross-mingw-w64: linux-cross-mingw-w64:
name: "linux-mingw, ${{ matrix.build == 'cmake' && 'CM' || 'AM' }} ${{ matrix.compiler }}" name: "linux-mingw, ${{ matrix.build == 'cmake' && 'CM' || 'AM' }} ${{ matrix.compiler }}"
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 15 timeout-minutes: 15
env:
MAKEFLAGS: -j 5
TRIPLET: 'x86_64-w64-mingw32'
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
build: [autotools, cmake] build: [autotools, cmake]
compiler: [gcc] compiler: [gcc]
env:
TRIPLET: 'x86_64-w64-mingw32'
steps: steps:
- name: 'install packages' - name: 'install packages'
timeout-minutes: 5
run: sudo apt-get -o Dpkg::Use-Pty=0 install mingw-w64 ${{ matrix.build == 'cmake' && 'ninja-build' || '' }} run: sudo apt-get -o Dpkg::Use-Pty=0 install mingw-w64 ${{ matrix.build == 'cmake' && 'ninja-build' || '' }}
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
@ -564,7 +567,7 @@ jobs:
if [ '${{ matrix.build }}' = 'cmake' ]; then if [ '${{ matrix.build }}' = 'cmake' ]; then
cmake --build bld cmake --build bld
else else
make -C bld -j5 make -C bld
fi fi
- name: 'curl info' - name: 'curl info'
@ -576,7 +579,7 @@ jobs:
if [ '${{ matrix.build }}' = 'cmake' ]; then if [ '${{ matrix.build }}' = 'cmake' ]; then
cmake --build bld --target testdeps cmake --build bld --target testdeps
else else
make -C bld -j5 -C tests make -C bld -C tests
fi fi
- name: 'build examples' - name: 'build examples'
@ -584,7 +587,7 @@ jobs:
if [ '${{ matrix.build }}' = 'cmake' ]; then if [ '${{ matrix.build }}' = 'cmake' ]; then
cmake --build bld --target curl-examples cmake --build bld --target curl-examples
else else
make -C bld -j5 examples make -C bld examples
fi fi
wince: wince:
@ -592,8 +595,8 @@ jobs:
runs-on: 'macos-latest' runs-on: 'macos-latest'
timeout-minutes: 10 timeout-minutes: 10
env: env:
toolchain-version: '0.59.1'
MAKEFLAGS: -j 4 MAKEFLAGS: -j 4
toolchain-version: '0.59.1'
strategy: strategy:
matrix: matrix:
build: [autotools, cmake] build: [autotools, cmake]
@ -601,6 +604,7 @@ jobs:
steps: steps:
- name: 'install packages' - name: 'install packages'
if: ${{ matrix.build == 'autotools' }} if: ${{ matrix.build == 'autotools' }}
timeout-minutes: 5
run: | run: |
echo automake libtool | xargs -Ix -n1 echo brew '"x"' > /tmp/Brewfile echo automake libtool | xargs -Ix -n1 echo brew '"x"' > /tmp/Brewfile
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 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
@ -614,6 +618,7 @@ jobs:
- name: 'install compiler (mingw32ce)' - name: 'install compiler (mingw32ce)'
if: ${{ steps.cache-compiler.outputs.cache-hit != 'true' }} if: ${{ steps.cache-compiler.outputs.cache-hit != 'true' }}
timeout-minutes: 5
run: | run: |
cd "${HOME}" || exit 1 cd "${HOME}" || exit 1
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 120 --retry 3 --retry-connrefused --proto-redir =https \ curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 120 --retry 3 --retry-connrefused --proto-redir =https \