Skip to content

Commit 25b56fd

Browse files
committed
ci: Test cross-built Windows executables on Windows natively
1 parent 3501bca commit 25b56fd

File tree

4 files changed

+66
-30
lines changed

4 files changed

+66
-30
lines changed

.github/workflows/ci.yml

+64-1
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ jobs:
269269
py -3 test/fuzz/test_runner.py --par $NUMBER_OF_PROCESSORS --loglevel DEBUG "${RUNNER_TEMP}/qa-assets/fuzz_corpora"
270270
271271
windows-cross:
272-
name: 'Linux->Windows cross, unit tests, no gui tests, no functional tests'
272+
name: 'Linux->Windows cross, no tests'
273273
runs-on: ubuntu-latest
274274
if: ${{ vars.SKIP_BRANCH_PUSH != 'true' || github.event_name == 'pull_request' }}
275275

@@ -312,6 +312,69 @@ jobs:
312312
path: ${{ env.CCACHE_DIR }}
313313
key: ${{ github.job }}-ccache-${{ github.run_id }}
314314

315+
- name: Upload built executables
316+
uses: actions/upload-artifact@v4
317+
with:
318+
name: x86_64-w64-mingw32-executables-${{ github.run_id }}
319+
path: |
320+
${{ env.BASE_BUILD_DIR }}/bin/*.exe
321+
${{ env.BASE_BUILD_DIR }}/src/secp256k1/bin/*.exe
322+
${{ env.BASE_BUILD_DIR }}/src/univalue/*.exe
323+
${{ env.BASE_BUILD_DIR }}/test/config.ini
324+
325+
windows-native-test:
326+
name: 'Windows, test cross-built'
327+
runs-on: windows-2022
328+
needs: windows-cross
329+
330+
env:
331+
PYTHONUTF8: 1
332+
TEST_RUNNER_TIMEOUT_FACTOR: 40
333+
334+
steps:
335+
- name: Checkout
336+
uses: actions/checkout@v4
337+
338+
- name: Download built executables
339+
uses: actions/download-artifact@v4
340+
with:
341+
name: x86_64-w64-mingw32-executables-${{ github.run_id }}
342+
343+
- name: Run bitcoind.exe
344+
run: ./bin/bitcoind.exe -version
345+
346+
- name: Run unit tests
347+
# Can't use ctest here like other jobs as we don't have a CMake build tree.
348+
run: |
349+
./bin/test_bitcoin.exe -l test_suite
350+
./src/secp256k1/bin/exhaustive_tests.exe
351+
./src/secp256k1/bin/noverify_tests.exe
352+
./src/secp256k1/bin/tests.exe
353+
./src/univalue/object.exe
354+
./src/univalue/unitester.exe
355+
356+
- name: Run benchmarks
357+
run: ./bin/bench_bitcoin.exe -sanity-check -priority-level=high
358+
359+
- name: Adjust paths in test/config.ini
360+
shell: pwsh
361+
run: |
362+
(Get-Content "test/config.ini") -replace '(?<=^SRCDIR=).*', '${{ github.workspace }}' -replace '(?<=^BUILDDIR=).*', '${{ github.workspace }}' -replace '(?<=^RPCAUTH=).*', '${{ github.workspace }}/share/rpcauth/rpcauth.py' | Set-Content "test/config.ini"
363+
Get-Content "test/config.ini"
364+
365+
- name: Run util tests
366+
run: py -3 test/util/test_runner.py
367+
368+
- name: Run rpcauth test
369+
run: py -3 test/util/rpcauth-test.py
370+
371+
- name: Run functional tests
372+
env:
373+
# TODO: Fix the excluded tests and re-enable them.
374+
EXCLUDE: '--exclude wallet_migration.py,wallet_multiwallet.py'
375+
TEST_RUNNER_EXTRA: ${{ github.event_name != 'pull_request' && '--extended' || '' }}
376+
run: py -3 test/functional/test_runner.py --jobs $NUMBER_OF_PROCESSORS --ci --quiet --tmpdirprefix="$RUNNER_TEMP" --combinedlogslen=99999999 --timeout-factor=$TEST_RUNNER_TIMEOUT_FACTOR $EXCLUDE $TEST_RUNNER_EXTRA
377+
315378
asan-lsan-ubsan-integer-no-depends-usdt:
316379
name: 'ASan + LSan + UBSan + integer, no depends, USDT'
317380
runs-on: ubuntu-24.04 # has to match container in ci/test/00_setup_env_native_asan.sh for tracing tools

ci/test/00_setup_env_win64.sh

+2-5
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,8 @@ export CONTAINER_NAME=ci_win64
1010
export CI_IMAGE_NAME_TAG="mirror.gcr.io/ubuntu:noble" # Check that g++-mingw-w64-x86-64-posix (version 13.2, similar to guix) can cross-compile
1111
export CI_IMAGE_PLATFORM="linux/amd64"
1212
export HOST=x86_64-w64-mingw32
13-
export DPKG_ADD_ARCH="i386"
14-
export PACKAGES="nsis g++-mingw-w64-x86-64-posix wine-binfmt wine64 wine32 file"
15-
# Install wine, but do not run unit tests, as they surface frequent
16-
# false-positives.
17-
export RUN_UNIT_TESTS=${RUN_UNIT_TESTS:-false}
13+
export PACKAGES="g++-mingw-w64-x86-64-posix nsis"
14+
export RUN_UNIT_TESTS=false
1815
export RUN_FUNCTIONAL_TESTS=false
1916
export GOAL="deploy"
2017
export BITCOIN_CONFIG="-DREDUCE_EXPORTS=ON -DBUILD_GUI_TESTS=OFF \

ci/test/03_test_script.sh

-4
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,6 @@ bash -c "${PRINT_CCACHE_STATISTICS}"
132132
du -sh "${DEPENDS_DIR}"/*/
133133
du -sh "${PREVIOUS_RELEASES_DIR}"
134134

135-
if [[ $HOST = *-mingw32 ]]; then
136-
"${BASE_ROOT_DIR}/ci/test/wrap-wine.sh"
137-
fi
138-
139135
if [ -n "$USE_VALGRIND" ]; then
140136
"${BASE_ROOT_DIR}/ci/test/wrap-valgrind.sh"
141137
fi

ci/test/wrap-wine.sh

-20
This file was deleted.

0 commit comments

Comments
 (0)