mirror of
https://github.com/libssh2/libssh2.git
synced 2025-11-20 02:42:09 +03:00
ci: sync names, steps, syntax, build dirname between jobs
Also: - delete an unused 64-bit option for Linux (all jobs are 64-bit). - fix to not install libgcrypt and openssl when doing mbedTLS builds. [ Empty lines after multiline run commands are solely to unbreak my editor's syntax highlighting. They can be deleted in the future ] Cherry-picked from #1017
This commit is contained in:
133
.github/workflows/ci.yml
vendored
133
.github/workflows/ci.yml
vendored
@@ -10,37 +10,34 @@ permissions: {}
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check_style:
|
check_style:
|
||||||
name: style-check
|
name: 'style-check'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 5
|
timeout-minutes: 5
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: Check Style
|
- name: 'checksrc'
|
||||||
run: ./ci/checksrc.sh
|
run: ./ci/checksrc.sh
|
||||||
|
|
||||||
build_linux:
|
build_linux:
|
||||||
name: linux
|
name: 'linux'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 60
|
timeout-minutes: 60
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
compiler: [gcc, clang]
|
compiler: [gcc, clang]
|
||||||
address_size: [64]
|
|
||||||
crypto_backend: [OpenSSL, Libgcrypt, mbedTLS]
|
crypto_backend: [OpenSSL, Libgcrypt, mbedTLS]
|
||||||
enable_zlib_compression: ['OFF', 'ON']
|
enable_zlib_compression: ['OFF', 'ON']
|
||||||
b: [cmake]
|
build: [cmake]
|
||||||
include:
|
include:
|
||||||
- compiler: gcc
|
- compiler: gcc
|
||||||
address_size: 64
|
|
||||||
crypto_backend: OpenSSL
|
crypto_backend: OpenSSL
|
||||||
enable_zlib_compression: 'OFF'
|
enable_zlib_compression: 'OFF'
|
||||||
b: configure
|
build: autotools
|
||||||
- compiler: clang
|
- compiler: clang
|
||||||
address_size: 64
|
|
||||||
crypto_backend: OpenSSL
|
crypto_backend: OpenSSL
|
||||||
enable_zlib_compression: 'OFF'
|
enable_zlib_compression: 'OFF'
|
||||||
b: configure
|
build: autotools
|
||||||
env:
|
env:
|
||||||
CC: ${{ matrix.compiler }}
|
CC: ${{ matrix.compiler }}
|
||||||
CC_FOR_BUILD: ${{ matrix.compiler }}
|
CC_FOR_BUILD: ${{ matrix.compiler }}
|
||||||
@@ -48,12 +45,10 @@ jobs:
|
|||||||
ENABLE_ZLIB_COMPRESSION: ${{ matrix.enable_zlib_compression }}
|
ENABLE_ZLIB_COMPRESSION: ${{ matrix.enable_zlib_compression }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: Install 64 Bit Dependencies
|
- name: 'install packages'
|
||||||
if: ${{ matrix.address_size == 64 }}
|
if: ${{ matrix.crypto_backend != 'mbedTLS' }}
|
||||||
run: |
|
run: sudo apt-get install -y libssl-dev libgcrypt-dev
|
||||||
sudo apt-get install -y libssl-dev
|
- name: 'install mbedTLS from source'
|
||||||
sudo apt-get install -y libgcrypt-dev
|
|
||||||
- name: Install mbedTLS Dependencies
|
|
||||||
if: ${{ matrix.crypto_backend == 'mbedTLS' }}
|
if: ${{ matrix.crypto_backend == 'mbedTLS' }}
|
||||||
run: |
|
run: |
|
||||||
MBEDTLSVER=mbedtls-3.4.0
|
MBEDTLSVER=mbedtls-3.4.0
|
||||||
@@ -66,31 +61,40 @@ jobs:
|
|||||||
cd ..
|
cd ..
|
||||||
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/usr/lib" >> $GITHUB_ENV
|
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/usr/lib" >> $GITHUB_ENV
|
||||||
echo "TOOLCHAIN_OPTION=$TOOLCHAIN_OPTION -DCMAKE_PREFIX_PATH=$PWD/usr" >> $GITHUB_ENV
|
echo "TOOLCHAIN_OPTION=$TOOLCHAIN_OPTION -DCMAKE_PREFIX_PATH=$PWD/usr" >> $GITHUB_ENV
|
||||||
- name: Build with Configure
|
|
||||||
if: ${{ matrix.b == 'configure' }}
|
- name: 'autotools autoreconf'
|
||||||
|
if: ${{ matrix.build == 'autotools' }}
|
||||||
|
run: autoreconf -fi
|
||||||
|
- name: 'autotools configure'
|
||||||
|
if: ${{ matrix.build == 'autotools' }}
|
||||||
|
run: ./configure --enable-werror --enable-debug
|
||||||
|
- name: 'autotools build'
|
||||||
|
if: ${{ matrix.build == 'autotools' }}
|
||||||
|
run: make -j3
|
||||||
|
- name: 'autotools tests'
|
||||||
|
if: ${{ matrix.build == 'autotools' }}
|
||||||
|
run: make check VERBOSE=1
|
||||||
|
- name: 'cmake configure'
|
||||||
|
if: ${{ matrix.build == 'cmake' }}
|
||||||
run: |
|
run: |
|
||||||
autoreconf -fi
|
cmake . -B bld $TOOLCHAIN_OPTION \
|
||||||
./configure --enable-werror --enable-debug
|
|
||||||
make -j3
|
|
||||||
make check VERBOSE=1
|
|
||||||
- name: Build with CMake
|
|
||||||
timeout-minutes: 10
|
|
||||||
if: ${{ matrix.b == 'cmake' }}
|
|
||||||
run: |
|
|
||||||
mkdir bin
|
|
||||||
cd bin
|
|
||||||
cmake $TOOLCHAIN_OPTION \
|
|
||||||
-DENABLE_WERROR=ON \
|
-DENABLE_WERROR=ON \
|
||||||
-DBUILD_SHARED_LIBS=ON \
|
-DBUILD_SHARED_LIBS=ON \
|
||||||
-DCRYPTO_BACKEND=$CRYPTO_BACKEND \
|
-DCRYPTO_BACKEND=$CRYPTO_BACKEND \
|
||||||
-DENABLE_ZLIB_COMPRESSION=$ENABLE_ZLIB_COMPRESSION ..
|
-DENABLE_ZLIB_COMPRESSION=$ENABLE_ZLIB_COMPRESSION
|
||||||
cmake --build .
|
|
||||||
export OPENSSH_SERVER_IMAGE=ghcr.io/libssh2/ci_tests_openssh_server:$(git rev-parse --short=20 HEAD:../tests/openssh_server)
|
- name: 'cmake build'
|
||||||
ctest -VV --output-on-failure
|
if: ${{ matrix.build == 'cmake' }}
|
||||||
cmake --build . --target package
|
run: cmake --build bld --target package
|
||||||
|
- name: 'cmake tests'
|
||||||
|
if: ${{ matrix.build == 'cmake' }}
|
||||||
|
timeout-minutes: 10
|
||||||
|
run: |
|
||||||
|
export OPENSSH_SERVER_IMAGE=ghcr.io/libssh2/ci_tests_openssh_server:$(git rev-parse --short=20 HEAD:tests/openssh_server)
|
||||||
|
cd bld && ctest -VV --output-on-failure
|
||||||
|
|
||||||
build_msys2:
|
build_msys2:
|
||||||
name: msys2
|
name: 'msys2'
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
strategy:
|
strategy:
|
||||||
@@ -110,13 +114,22 @@ jobs:
|
|||||||
mingw-w64-${{ matrix.env }}-cc
|
mingw-w64-${{ matrix.env }}-cc
|
||||||
mingw-w64-${{ matrix.env }}-autotools
|
mingw-w64-${{ matrix.env }}-autotools
|
||||||
mingw-w64-${{ matrix.env }}-openssl
|
mingw-w64-${{ matrix.env }}-openssl
|
||||||
- name: Building libssh2
|
|
||||||
|
- name: 'autotools autoreconf'
|
||||||
|
shell: msys2 {0}
|
||||||
|
run: autoreconf -fi
|
||||||
|
- name: 'autotools configure'
|
||||||
shell: msys2 {0}
|
shell: msys2 {0}
|
||||||
run: |
|
run: |
|
||||||
autoreconf -fi
|
./configure --enable-werror --enable-debug --enable-static --disable-shared \
|
||||||
./configure --enable-werror --enable-debug --enable-static --disable-shared --with-crypto=openssl
|
--with-crypto=openssl
|
||||||
make -j3
|
|
||||||
make check VERBOSE=1
|
- name: 'autotools build'
|
||||||
|
shell: msys2 {0}
|
||||||
|
run: make -j3
|
||||||
|
- name: 'autotools tests'
|
||||||
|
shell: msys2 {0}
|
||||||
|
run: make check VERBOSE=1
|
||||||
|
|
||||||
build_msys2_gnu_make:
|
build_msys2_gnu_make:
|
||||||
name: 'msys2 (mingw64, x86_64, Makefile.mk)'
|
name: 'msys2 (mingw64, x86_64, Makefile.mk)'
|
||||||
@@ -136,7 +149,7 @@ jobs:
|
|||||||
run: mkdir bld && cd bld && BLD_DIR=bld make -C .. -j3 -f Makefile.mk dyn example test
|
run: mkdir bld && cd bld && BLD_DIR=bld make -C .. -j3 -f Makefile.mk dyn example test
|
||||||
|
|
||||||
build_msvc:
|
build_msvc:
|
||||||
name: msvc
|
name: 'msvc'
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
strategy:
|
strategy:
|
||||||
@@ -152,7 +165,7 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: 'cmake generate'
|
- name: 'cmake configure'
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
archgen=${{ matrix.arch }}; [ "${archgen}" = 'x86' ] && archgen='Win32'
|
archgen=${{ matrix.arch }}; [ "${archgen}" = 'x86' ] && archgen='Win32'
|
||||||
@@ -172,12 +185,12 @@ jobs:
|
|||||||
-DBUILD_SHARED_LIBS=${{ matrix.shared }} \
|
-DBUILD_SHARED_LIBS=${{ matrix.shared }} \
|
||||||
-DCRYPTO_BACKEND=${{ matrix.crypto }} \
|
-DCRYPTO_BACKEND=${{ matrix.crypto }} \
|
||||||
-DENABLE_ZLIB_COMPRESSION=${{ matrix.zlib }}
|
-DENABLE_ZLIB_COMPRESSION=${{ matrix.zlib }}
|
||||||
|
|
||||||
- name: 'cmake build'
|
- name: 'cmake build'
|
||||||
run: |
|
run: cmake --build bld --target package --config Release
|
||||||
cmake --build bld --config Release --target package
|
|
||||||
|
|
||||||
build_macos:
|
build_macos:
|
||||||
name: macOS (${{ matrix.build }}, ${{ matrix.crypto.name }})
|
name: 'macOS (${{ matrix.build }}, ${{ matrix.crypto.name }})'
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
strategy:
|
strategy:
|
||||||
@@ -185,58 +198,54 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
build: [autotools, cmake]
|
build: [autotools, cmake]
|
||||||
crypto:
|
crypto:
|
||||||
- name: OpenSSL 3
|
- name: 'OpenSSL 3'
|
||||||
install: openssl
|
install: openssl
|
||||||
configure: --with-crypto=openssl --with-libssl-prefix=/usr/local/opt/openssl
|
configure: --with-crypto=openssl --with-libssl-prefix=/usr/local/opt/openssl
|
||||||
cmake: -DCRYPTO_BACKEND=OpenSSL -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl
|
cmake: -DCRYPTO_BACKEND=OpenSSL -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl
|
||||||
- name: OpenSSL 1.1
|
- name: 'OpenSSL 1.1'
|
||||||
install: openssl@1.1
|
install: openssl@1.1
|
||||||
configure: --with-crypto=openssl --with-libssl-prefix=/usr/local/opt/openssl@1.1
|
configure: --with-crypto=openssl --with-libssl-prefix=/usr/local/opt/openssl@1.1
|
||||||
cmake: -DCRYPTO_BACKEND=OpenSSL -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl@1.1
|
cmake: -DCRYPTO_BACKEND=OpenSSL -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl@1.1
|
||||||
- name: LibreSSL
|
- name: 'LibreSSL'
|
||||||
install: libressl
|
install: libressl
|
||||||
configure: --with-crypto=openssl --with-libssl-prefix=/usr/local/opt/libressl
|
configure: --with-crypto=openssl --with-libssl-prefix=/usr/local/opt/libressl
|
||||||
cmake: -DCRYPTO_BACKEND=OpenSSL -DOPENSSL_ROOT_DIR=/usr/local/opt/libressl
|
cmake: -DCRYPTO_BACKEND=OpenSSL -DOPENSSL_ROOT_DIR=/usr/local/opt/libressl
|
||||||
- name: wolfSSL
|
- name: 'wolfSSL'
|
||||||
install: wolfssl
|
install: wolfssl
|
||||||
configure: --with-crypto=wolfssl --with-libwolfssl-prefix=/usr/local/opt/wolfssl
|
configure: --with-crypto=wolfssl --with-libwolfssl-prefix=/usr/local/opt/wolfssl
|
||||||
cmake: -DCRYPTO_BACKEND=wolfSSL
|
cmake: -DCRYPTO_BACKEND=wolfSSL
|
||||||
- name: libgcrypt
|
- name: 'libgcrypt'
|
||||||
install: libgcrypt
|
install: libgcrypt
|
||||||
configure: --with-crypto=libgcrypt --with-libgcrypt-prefix=/usr/local/opt/libgcrypt
|
configure: --with-crypto=libgcrypt --with-libgcrypt-prefix=/usr/local/opt/libgcrypt
|
||||||
cmake: -DCRYPTO_BACKEND=Libgcrypt
|
cmake: -DCRYPTO_BACKEND=Libgcrypt
|
||||||
- name: mbedTLS
|
- name: 'mbedTLS'
|
||||||
install: mbedtls
|
install: mbedtls
|
||||||
configure: --with-crypto=mbedtls --with-libmbedcrypto-prefix=/usr/local/opt/mbedtls
|
configure: --with-crypto=mbedtls --with-libmbedcrypto-prefix=/usr/local/opt/mbedtls
|
||||||
cmake: -DCRYPTO_BACKEND=mbedTLS -DMBEDCRYPTO_LIBRARY=/usr/local/opt/mbedtls/lib/libmbedcrypto.a -DMBEDTLS_LIBRARY=/usr/local/opt/mbedtls/lib/libmbedtls.a -DMBEDX509_LIBRARY=/usr/local/opt/mbedtls/lib/libmbedx509.a -DMBEDTLS_INCLUDE_DIR=/usr/local/opt/mbedtls/include
|
cmake: -DCRYPTO_BACKEND=mbedTLS -DMBEDCRYPTO_LIBRARY=/usr/local/opt/mbedtls/lib/libmbedcrypto.a -DMBEDTLS_LIBRARY=/usr/local/opt/mbedtls/lib/libmbedtls.a -DMBEDX509_LIBRARY=/usr/local/opt/mbedtls/lib/libmbedx509.a -DMBEDTLS_INCLUDE_DIR=/usr/local/opt/mbedtls/include
|
||||||
steps:
|
steps:
|
||||||
- name: 'brew install'
|
- name: 'install packages'
|
||||||
run: |
|
run: brew install automake ${{ matrix.crypto.install }}
|
||||||
brew install automake ${{ matrix.crypto.install }}
|
|
||||||
|
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: 'autotools autoreconf'
|
- name: 'autotools autoreconf'
|
||||||
if: ${{ matrix.build == 'autotools' }}
|
if: ${{ matrix.build == 'autotools' }}
|
||||||
run: autoreconf -fi
|
run: autoreconf -fi
|
||||||
- name: 'autotools configure'
|
- name: 'autotools configure'
|
||||||
if: ${{ matrix.build == 'autotools' }}
|
if: ${{ matrix.build == 'autotools' }}
|
||||||
run: |
|
run: |
|
||||||
./configure ${{ matrix.crypto.configure }} \
|
./configure --enable-werror --enable-debug \
|
||||||
--enable-werror \
|
--with-libz ${{ matrix.crypto.configure }}
|
||||||
--enable-debug \
|
|
||||||
--with-libz
|
- name: 'autotools build'
|
||||||
- name: 'autotools make'
|
|
||||||
if: ${{ matrix.build == 'autotools' }}
|
if: ${{ matrix.build == 'autotools' }}
|
||||||
run: make
|
run: make
|
||||||
|
- name: 'cmake configure'
|
||||||
- name: 'cmake generate'
|
|
||||||
if: ${{ matrix.build == 'cmake' }}
|
if: ${{ matrix.build == 'cmake' }}
|
||||||
run: |
|
run: |
|
||||||
cmake . -B bld ${{ matrix.crypto.cmake }} \
|
cmake . -B bld ${{ matrix.crypto.cmake }} \
|
||||||
-DENABLE_WERROR=ON \
|
-DENABLE_WERROR=ON \
|
||||||
-DENABLE_DEBUG_LOGGING=ON \
|
-DENABLE_DEBUG_LOGGING=ON \
|
||||||
-DENABLE_ZLIB_COMPRESSION=ON
|
-DENABLE_ZLIB_COMPRESSION=ON
|
||||||
|
|
||||||
- name: 'cmake build'
|
- name: 'cmake build'
|
||||||
if: ${{ matrix.build == 'cmake' }}
|
if: ${{ matrix.build == 'cmake' }}
|
||||||
run: cmake --build bld
|
run: cmake --build bld
|
||||||
|
|||||||
Reference in New Issue
Block a user