Skip to content

Commit 2e27bd9

Browse files
hebastowillcl-ark
andcommitted
ci: Add Windows + UCRT jobs for cross-compiling and native testing
Co-authored-by: will <[email protected]>
1 parent bd130db commit 2e27bd9

File tree

2 files changed

+53
-8
lines changed

2 files changed

+53
-8
lines changed

.github/workflows/ci.yml

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -343,14 +343,26 @@ jobs:
343343
run: |
344344
py -3 test/fuzz/test_runner.py --par $NUMBER_OF_PROCESSORS --loglevel DEBUG "${RUNNER_TEMP}/qa-assets/fuzz_corpora"
345345
346-
windows-msvcrt-cross:
347-
name: 'Windows-cross to x86_64, MSVCRT'
346+
windows-cross:
347+
name: 'Windows-cross to x86_64, ${{ matrix.crt }}'
348348
needs: runners
349349
runs-on: ${{ needs.runners.outputs.provider == 'cirrus' && 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-sm' || 'ubuntu-24.04' }}
350350
if: ${{ vars.SKIP_BRANCH_PUSH != 'true' || github.event_name == 'pull_request' }}
351351

352+
strategy:
353+
fail-fast: false
354+
matrix:
355+
crt: [msvcrt, ucrt]
356+
include:
357+
- crt: msvcrt
358+
file-env: './ci/test/00_setup_env_win64_msvcrt.sh'
359+
artifact-name: 'x86_64-w64-mingw32-executables'
360+
- crt: ucrt
361+
file-env: './ci/test/00_setup_env_win64.sh'
362+
artifact-name: 'x86_64-w64-mingw32ucrt-executables'
363+
352364
env:
353-
FILE_ENV: './ci/test/00_setup_env_win64_msvcrt.sh'
365+
FILE_ENV: ${{ matrix.file-env }}
354366
DANGER_CI_ON_HOST_FOLDERS: 1
355367

356368
steps:
@@ -379,18 +391,28 @@ jobs:
379391
- name: Upload built executables
380392
uses: actions/upload-artifact@v4
381393
with:
382-
name: x86_64-w64-mingw32-executables-${{ github.run_id }}
394+
name: ${{ matrix.artifact-name }}-${{ github.run_id }}
383395
path: |
384396
${{ env.BASE_BUILD_DIR }}/bin/*.dll
385397
${{ env.BASE_BUILD_DIR }}/bin/*.exe
386398
${{ env.BASE_BUILD_DIR }}/src/secp256k1/bin/*.exe
387399
${{ env.BASE_BUILD_DIR }}/src/univalue/*.exe
388400
${{ env.BASE_BUILD_DIR }}/test/config.ini
389401
390-
windows-msvcrt-native-test:
391-
name: 'Windows, MSVCRT, test cross-built'
402+
windows-native-test:
403+
name: 'Windows, ${{ matrix.crt }}, test cross-built'
392404
runs-on: windows-2022
393-
needs: windows-msvcrt-cross
405+
needs: windows-cross
406+
407+
strategy:
408+
fail-fast: false
409+
matrix:
410+
crt: [msvcrt, ucrt]
411+
include:
412+
- crt: msvcrt
413+
artifact-name: 'x86_64-w64-mingw32-executables'
414+
- crt: ucrt
415+
artifact-name: 'x86_64-w64-mingw32ucrt-executables'
394416

395417
env:
396418
PYTHONUTF8: 1
@@ -404,7 +426,7 @@ jobs:
404426
- name: Download built executables
405427
uses: actions/download-artifact@v5
406428
with:
407-
name: x86_64-w64-mingw32-executables-${{ github.run_id }}
429+
name: ${{ matrix.artifact-name }}-${{ github.run_id }}
408430

409431
- name: Run bitcoind.exe
410432
run: ./bin/bitcoind.exe -version

ci/test/00_setup_env_win64.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Copyright (c) 2025-present The Bitcoin Core developers
4+
# Distributed under the MIT software license, see the accompanying
5+
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
6+
7+
export LC_ALL=C.UTF-8
8+
9+
export CONTAINER_NAME=ci_win64
10+
export CI_IMAGE_NAME_TAG="mirror.gcr.io/debian:trixie" # Check that https://packages.debian.org/trixie/g++-mingw-w64-ucrt64 can cross-compile
11+
export HOST=x86_64-w64-mingw32ucrt
12+
export DEP_OPTS="CC=${HOST}-gcc CXX=${HOST}-g++"
13+
export PACKAGES="g++-mingw-w64-ucrt64 nsis"
14+
export RUN_UNIT_TESTS=false
15+
export RUN_FUNCTIONAL_TESTS=false
16+
export GOAL="deploy"
17+
export BITCOIN_CONFIG="\
18+
--preset=dev-mode \
19+
-DENABLE_IPC=OFF \
20+
-DWITH_USDT=OFF \
21+
-DREDUCE_EXPORTS=ON \
22+
-DCMAKE_CXX_FLAGS='-Wno-error=maybe-uninitialized' \
23+
"

0 commit comments

Comments
 (0)