curl/.github/workflows/non-native.yml
Viktor Szakats b158d1c9f7
GHA/non-native: move BSDs to a single matrix, add DragonFly and Midnight
- bump cross-platform-actions to v1.1.0.
  Ref: https://github.com/cross-platform-actions/action/releases/tag/v1.1.0

- merge BSD jobs into a single matrix.

- split BSD jobs into build steps as used for other platforms.
  A new feature of cross-platform-actions v1.1.0.

- sync BSD build steps with other platforms.

- add DragonFlyBSD and MidnightBSD to the BSD matrix.
  New features of cross-platform-actions v1.1.0.
  MidnightBSD uses GnuTLS to add variation, also the preinstalled
  OpenSSL is too old (v1.1.1w) for curl.
  Stick with autotools for DragonFlyBSD; I could not figure out how
  to install cmake.
  Refs:
  https://en.wikipedia.org/wiki/DragonFly_BSD
  https://en.wikipedia.org/wiki/MidnightBSD

- bump Intel FreeBSD jobs from v14.3 to v15.0.

- fix to show `gcc` in the NetBSD job name.

All these saved 50 lines of YAML. The two new jobs take 2m15s each. The
bump to FreeBSD 15 needs and extra minute in total.

Note, the DragonFlyBSD job seems to have reliability issues. If it
remains an issue, I'll comment it out or delete it in a future commit.

Closes #21681
2026-05-20 03:19:02 +02:00

406 lines
16 KiB
YAML

# Copyright (C) Viktor Szakats
#
# SPDX-License-Identifier: curl
name: 'non-native'
'on':
push:
branches:
- master
- '*/ci'
paths-ignore:
- '**/*.md'
- '.circleci/**'
- 'appveyor.*'
- 'Dockerfile'
- 'projects/**'
pull_request:
branches:
- master
paths-ignore:
- '**/*.md'
- '.circleci/**'
- 'appveyor.*'
- 'Dockerfile'
- 'projects/**'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
permissions: {}
env:
CURL_CI: github
CURL_TEST_MIN: 1820
DO_NOT_TRACK: '1'
jobs:
cross:
name: "${{ matrix.os }} ${{ matrix.version }}, ${{ matrix.build == 'cmake' && 'CM' || 'AM' }} ${{ matrix.cc }} ${{ matrix.desc }} ${{ matrix.arch }}"
runs-on: ubuntu-latest
timeout-minutes: 15
defaults:
run:
shell: cpa.sh {0} # zizmor: ignore[misfeature]
env:
CC: '${{ matrix.cc }}'
MAKEFLAGS: -j 3
MATRIX_ARCH: '${{ matrix.arch }}'
MATRIX_BUILD: '${{ matrix.build }}'
MATRIX_OPTIONS: '${{ matrix.options }}'
MATRIX_OS: '${{ matrix.os }}'
strategy:
matrix:
include:
- { os: 'dragonflybsd', version: '6.4.2', build: 'autotools', arch: 'x86_64', cc: 'gcc' , desc: 'openssl !runtests',
options: '--with-openssl' }
- { os: 'freebsd', version: '15.0', build: 'autotools', arch: 'x86_64', cc: 'clang', desc: 'openssl',
options: '--with-openssl --with-gssapi' }
- { os: 'freebsd', version: '15.0', build: 'cmake' , arch: 'x86_64', cc: 'clang', desc: 'openssl !unity !runtests !examples',
options: '-DCURL_USE_GSSAPI=ON -DCMAKE_UNITY_BUILD=OFF' }
- { os: 'freebsd', version: '14.3', build: 'autotools', arch: 'arm64' , cc: 'clang', desc: 'openssl !examples',
options: '--with-openssl --with-gssapi' }
- { os: 'freebsd', version: '14.3', build: 'cmake' , arch: 'arm64' , cc: 'clang', desc: 'openssl',
options: '-DCURL_USE_GSSAPI=ON' }
- { os: 'midnightbsd', version: '4.0.4', build: 'cmake' , arch: 'x86_64', cc: 'clang', desc: 'gnutls !runtests',
options: '-DCURL_USE_GNUTLS=ON' }
- { os: 'netbsd', version: '10.1' , build: 'cmake' , arch: 'x86_64', cc: 'gcc' , desc: 'openssl',
options: '-DCURL_USE_GSSAPI=ON' }
- { os: 'openbsd', version: '7.7' , build: 'cmake' , arch: 'x86_64', cc: 'clang', desc: 'libressl' }
fail-fast: false
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: 'setup VM'
uses: cross-platform-actions/action@0c165ad7eb2d6a7e8552d6af5aad2bbedfc646b0 # v1.1.0
with:
environment_variables: 'CC CURL_CI CURL_TEST_MIN DO_NOT_TRACK MAKEFLAGS MATRIX_ARCH MATRIX_BUILD MATRIX_OPTIONS MATRIX_OS'
operating_system: '${{ matrix.os }}'
version: '${{ matrix.version }}'
architecture: '${{ matrix.arch }}'
- name: 'install prereqs'
run: |
if [ "${MATRIX_OS}" = 'dragonflybsd' ]; then
sudo pkg install -y autoconf automake libtool perl5 pkgconf brotli openldap26-client libidn2 libnghttp2
elif [ "${MATRIX_OS}" = 'freebsd' ]; then
# https://ports.freebsd.org/
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
tools='cmake-core ninja perl5'
else
tools='autoconf automake libtool'
fi
sudo pkg install -y ${tools} pkgconf brotli krb5-devel openldap26-client libidn2 libnghttp2 stunnel py311-impacket
elif [ "${MATRIX_OS}" = 'midnightbsd' ]; then
# https://app.midnightbsd.org/
# https://man.midnightbsd.org/cgi-bin/man.cgi/mport
sudo mport -q install cmake-core ninja perl5 pkgconf brotli gnutls openldap26-client libidn2 libnghttp2 | grep -E '(Downloading.+100|Installing)' || true
elif [ "${MATRIX_OS}" = 'netbsd' ]; then
# https://pkgsrc.se/
sudo pkgin -y install cmake ninja-build pkg-config perl brotli mit-krb5 openldap-client libssh2 libidn2 libpsl nghttp2 py311-impacket
elif [ "${MATRIX_OS}" = 'openbsd' ]; then
# https://openbsd.app/
# https://www.openbsd.org/faq/faq15.html
sudo pkg_add cmake ninja brotli openldap-client-- libssh2 libidn2 libpsl nghttp2 py3-six py3-impacket
fi
- name: 'autoreconf'
if: ${{ matrix.build == 'autotools' }}
run: autoreconf -fi
- name: 'configure'
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake -B bld -G Ninja -DCMAKE_INSTALL_PREFIX="$HOME"/curl-install \
-DCMAKE_C_COMPILER="${CC}" \
-DCMAKE_UNITY_BUILD=ON -DCURL_WERROR=ON -DENABLE_DEBUG=ON -DCMAKE_BUILD_TYPE=Debug \
-DCURL_ENABLE_NTLM=ON ${MATRIX_OPTIONS}
else
if [ "${MATRIX_ARCH}" != 'x86_64' ]; then
options='--disable-manual --disable-docs' # Slow with autotools, skip on emulated CPU
fi
mkdir bld && cd bld
../configure --prefix="$HOME"/curl-install --enable-unity --enable-debug --enable-warnings --enable-werror --disable-static \
--disable-dependency-tracking --enable-option-checking=fatal \
--with-brotli --enable-ldap --enable-ldaps --with-libidn2 --with-libssh2 --with-nghttp2 \
${options} ${MATRIX_OPTIONS}
fi
- name: 'configure log'
if: ${{ !cancelled() }}
run: cat bld/config.log bld/CMakeFiles/CMakeConfigureLog.yaml 2>/dev/null || true
- name: 'curl_config.h'
run: |
echo '::group::raw'; cat bld/lib/curl_config.h || true; echo '::endgroup::'
grep -F '#define' bld/lib/curl_config.h | sort || true
- name: 'build'
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld
else
make -C bld
fi
- name: 'curl -V'
run: bld/src/curl --disable --version
- name: 'curl install'
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --install bld
else
make -C bld install
fi
- name: 'build tests'
if: ${{ matrix.arch == 'x86_64' }} # Slow on emulated CPU
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld --target testdeps
else
make -C bld -C tests
fi
- name: 'run tests'
if: ${{ matrix.arch == 'x86_64' && !contains(matrix.desc, '!runtests') }} # Slow on emulated CPU
run: |
export TFLAGS='-j8'
if [ "${MATRIX_OS}" = 'openbsd' ]; then
TFLAGS="$TFLAGS !2707" # Skip 2707 'ws: Peculiar frame sizes' on suspicion of hangs
fi
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld --verbose --target test-ci
else
make -C bld V=1 test-ci
fi
- name: 'build examples'
if: ${{ !contains(matrix.desc, '!examples') }}
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld --target curl-examples-build
else
make -C bld examples
fi
android:
name: "Android ${{ matrix.platform }}, ${{ matrix.build == 'cmake' && 'CM' || 'AM' }} ${{ matrix.name }} arm64"
runs-on: ubuntu-latest
timeout-minutes: 5
env:
LDFLAGS: -s
MAKEFLAGS: -j 5
MATRIX_BUILD: '${{ matrix.build }}'
strategy:
matrix:
include:
- { build: 'autotools', platform: '21', name: "!ssl !zstd",
options: '--without-ssl --without-libpsl --without-zstd' }
- { build: 'cmake' , platform: '21', name: "!ssl !zstd",
options: '-DCURL_ENABLE_SSL=OFF -DCURL_USE_LIBPSL=OFF -DCURL_ZSTD=OFF' }
- { build: 'autotools', platform: '35', name: "!ssl !zstd",
options: '--without-ssl --without-libpsl --without-zstd' }
- { build: 'cmake' , platform: '35', name: "!ssl !zstd",
options: '-DCURL_ENABLE_SSL=OFF -DCURL_USE_LIBPSL=OFF -DCURL_ZSTD=OFF' }
fail-fast: false
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: 'autoreconf'
if: ${{ matrix.build == 'autotools' }}
run: autoreconf -fi
- name: 'configure'
env:
MATRIX_OPTIONS: '${{ matrix.options }}'
MATRIX_PLATFORM: '${{ matrix.platform }}'
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then # https://developer.android.com/ndk/guides/cmake
cmake -B bld -G Ninja \
-DANDROID_ABI=arm64-v8a \
-DANDROID_PLATFORM="android-${MATRIX_PLATFORM}" \
-DCMAKE_TOOLCHAIN_FILE="${ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake" -DCMAKE_WARN_DEPRECATED=OFF \
-DCMAKE_UNITY_BUILD=ON \
-DCURL_WERROR=ON \
${MATRIX_OPTIONS}
else
TOOLCHAIN="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64"
mkdir bld && cd bld && ../configure --enable-unity --enable-warnings --enable-werror --disable-shared \
--disable-dependency-tracking --enable-option-checking=fatal \
CC="$TOOLCHAIN/bin/aarch64-linux-android${MATRIX_PLATFORM}-clang" \
AR="$TOOLCHAIN/bin/llvm-ar" \
RANLIB="$TOOLCHAIN/bin/llvm-ranlib" \
--host="aarch64-linux-android${MATRIX_PLATFORM}" \
${MATRIX_OPTIONS}
fi
- name: 'configure log'
if: ${{ !cancelled() }}
run: cat bld/config.log bld/CMakeFiles/CMake*.yaml 2>/dev/null || true
- name: 'dump config files'
run: |
for f in libcurl.pc curl-config; do
echo "::group::${f}"; grep -v '^#' bld/"${f}" || true; echo '::endgroup::'
done
- name: 'curl_config.h'
run: |
echo '::group::raw'; cat bld/lib/curl_config.h || true; echo '::endgroup::'
grep -F '#define' bld/lib/curl_config.h | sort || true
- name: 'build'
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld --verbose
else
make -C bld V=1
fi
- name: 'curl info'
run: |
find . -type f \( -name curl -o -name '*.so' -o -name '*.a' \) -print0 | xargs -0 file --
find . -type f \( -name curl -o -name '*.so' -o -name '*.a' \) -print0 | xargs -0 stat -c '%10s bytes: %n' --
- name: 'build tests'
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld --target testdeps
else
make -C bld -C tests
fi
- name: 'build examples'
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld --target curl-examples-build
else
make -C bld examples
fi
msdos:
name: "MS-DOS, ${{ matrix.build == 'cmake' && 'CM' || 'AM' }} djgpp !ssl i586"
runs-on: ubuntu-latest
timeout-minutes: 5
env:
LDFLAGS: -s
MAKEFLAGS: -j 5
MATRIX_BUILD: '${{ matrix.build }}'
# renovate: datasource=github-releases depName=andrewwutw/build-djgpp versioning=semver-coerced registryUrl=https://github.com
TOOLCHAIN_VERSION: 3.4
TOOLCHAIN_SHA256: 8464f17017d6ab1b2bb2df4ed82357b5bf692e6e2b7fee37e315638f3d505f00
strategy:
matrix:
build: [autotools, cmake]
fail-fast: false
steps:
- name: 'install packages'
timeout-minutes: 2
run: |
sudo sed -i 's/priority:1/priority:9/' /etc/apt/apt-mirrors.txt; cat /etc/apt/apt-mirrors.txt
sudo apt-get -o Dpkg::Use-Pty=0 install libfl2
- name: 'cache compiler (djgpp)'
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
id: cache-compiler
with:
path: ~/djgpp
key: ${{ runner.os }}-djgpp-${{ env.TOOLCHAIN_VERSION }}-amd64
- name: 'install compiler (djgpp)'
if: ${{ steps.cache-compiler.outputs.cache-hit != 'true' }}
run: |
cd ~
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 120 --retry 3 --retry-connrefused \
--location "https://github.com/andrewwutw/build-djgpp/releases/download/v${TOOLCHAIN_VERSION}/djgpp-linux64-gcc1220.tar.bz2" --output pkg.bin
sha256sum pkg.bin | tee /dev/stderr | grep -qwF -- "${TOOLCHAIN_SHA256}" && tar -xjf pkg.bin && rm -f pkg.bin
cd djgpp
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 --retry-connrefused \
https://www.delorie.com/pub/djgpp/current/v2tk/wat3211b.zip --output pkg.bin
sha256sum pkg.bin | tee /dev/stderr | grep -qwF faa2222ab5deb2c2aac229c760bf4d45aca5379f5af97865c308a0467046b67a && unzip -q pkg.bin && rm -f pkg.bin
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 --retry-connrefused \
https://www.delorie.com/pub/djgpp/current/v2tk/zlb13b.zip --output pkg.bin
sha256sum pkg.bin | tee /dev/stderr | grep -qwF f3d2fa8129e7591c7e79074306d8ab91a70ec172cc01baedeae74992285dd3a3 && unzip -q pkg.bin && rm -f pkg.bin
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: 'configure'
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake -B bld -G Ninja \
-DCMAKE_SYSTEM_NAME=DOS \
-DCMAKE_SYSTEM_PROCESSOR=x86 \
-DCMAKE_C_COMPILER_TARGET=i586-pc-msdosdjgpp \
-DCMAKE_C_COMPILER="$HOME"/djgpp/bin/i586-pc-msdosdjgpp-gcc \
-DCMAKE_UNITY_BUILD=ON \
-DCURL_WERROR=ON \
-DCURL_ENABLE_SSL=OFF -DCURL_USE_LIBPSL=OFF \
-DZLIB_INCLUDE_DIR="$HOME"/djgpp/include \
-DZLIB_LIBRARY="$HOME"/djgpp/lib/libz.a \
-DWATT_ROOT="$HOME"/djgpp/net/watt
else
autoreconf -fi
mkdir bld && cd bld && ../configure --enable-unity --enable-warnings --enable-werror --disable-shared \
--disable-dependency-tracking --enable-option-checking=fatal \
CC="$HOME"/djgpp/bin/i586-pc-msdosdjgpp-gcc \
AR="$HOME"/djgpp/bin/i586-pc-msdosdjgpp-ar \
RANLIB="$HOME"/djgpp/bin/i586-pc-msdosdjgpp-ranlib \
WATT_ROOT="$HOME"/djgpp/net/watt \
--host=i586-pc-msdosdjgpp \
--without-ssl --without-libpsl \
--with-zlib="$HOME"/djgpp
fi
- name: 'configure log'
if: ${{ !cancelled() }}
run: cat bld/config.log bld/CMakeFiles/CMake*.yaml 2>/dev/null || true
- name: 'curl_config.h'
run: |
echo '::group::raw'; cat bld/lib/curl_config.h || true; echo '::endgroup::'
grep -F '#define' bld/lib/curl_config.h | sort || true
- name: 'build'
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld
else
make -C bld
fi
- name: 'curl info'
run: |
find . \( -name '*.exe' -o -name '*.a' \) -print0 | xargs -0 file --
find . \( -name '*.exe' -o -name '*.a' \) -print0 | xargs -0 stat -c '%10s bytes: %n' --
- name: 'build tests'
if: ${{ matrix.build == 'cmake' }} # skip for autotools to save time
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld --target testdeps
else
make -C bld -C tests
fi
- name: 'build examples'
if: ${{ matrix.build == 'cmake' }} # skip for autotools to save time
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld --target curl-examples-build
else
make -C bld examples
fi