1
0
mirror of https://github.com/libssh2/libssh2.git synced 2026-01-27 00:18:12 +03:00

ci/GHA: sync linux-mingw workflow with curl

To prepare for the addition of a clang-tidy job for Windows.

Cherry-picked from #1561
This commit is contained in:
Viktor Szakats
2025-03-21 00:42:11 +01:00
parent 64fafc78b0
commit 15752e5f0b

View File

@@ -517,15 +517,17 @@ jobs:
cd bld && ctest -VV --output-on-failure
build_linux_cross_mingw64:
name: 'linux -> mingw-w64'
name: "linux -> mingw-w64, ${{ matrix.build == 'cmake' && 'CM' || 'AM' }} ${{ matrix.compiler }}"
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
build: [autotools, cmake]
compiler: [gcc]
include:
- { build: 'autotools', compiler: 'gcc' }
- { build: 'cmake' , compiler: 'gcc' }
env:
MAKEFLAGS: -j 5
TRIPLET: 'x86_64-w64-mingw32'
steps:
- name: 'install packages'
@@ -534,29 +536,35 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
persist-credentials: false
- name: 'autotools autoreconf'
- name: 'autoreconf'
if: ${{ matrix.build == 'autotools' }}
run: autoreconf -fi
- name: 'autotools configure'
if: ${{ matrix.build == 'autotools' }}
run: mkdir bld && cd bld && ../configure --enable-werror --enable-debug --host="${TRIPLET}" --disable-dependency-tracking || { tail -n 1000 config.log; false; }
- name: 'autotools build'
if: ${{ matrix.build == 'autotools' }}
run: make -C bld -j5
- name: 'cmake configure'
if: ${{ matrix.build == 'cmake' }}
run: |
cmake -B bld -G Ninja \
-DCMAKE_SYSTEM_NAME=Windows \
-DCMAKE_C_COMPILER_TARGET=${TRIPLET} \
-DCMAKE_C_COMPILER=${TRIPLET}-gcc \
-DCMAKE_UNITY_BUILD=ON \
-DENABLE_WERROR=ON \
|| { cat bld/CMakeFiles/CMake*.yaml; false; }
- name: 'cmake build'
if: ${{ matrix.build == 'cmake' }}
run: cmake --build bld --parallel 5
- name: 'configure'
run: |
if [ '${{ matrix.build }}' = 'cmake' ]; then
cmake -B bld -G Ninja \
-DCMAKE_SYSTEM_NAME=Windows \
-DCMAKE_C_COMPILER_TARGET=${TRIPLET} \
-DCMAKE_C_COMPILER=${TRIPLET}-gcc \
-DCMAKE_UNITY_BUILD=ON \
-DENABLE_WERROR=ON \
|| { cat bld/CMakeFiles/CMake*.yaml; false; }
else
mkdir bld && cd bld && ../configure --enable-werror --enable-debug \
--host="${TRIPLET}" \
--disable-dependency-tracking \
|| { tail -n 1000 config.log; false; }
fi
- name: 'build'
run: |
if [ '${{ matrix.build }}' = 'cmake' ]; then
cmake --build bld
else
make -C bld
fi
build_cygwin:
name: 'cygwin'