Skip to content

Commit

Permalink
ci: Test cross-built Windows executables on Windows natively
Browse files Browse the repository at this point in the history
  • Loading branch information
hebasto committed Jan 6, 2025
1 parent 041cfc9 commit 8331141
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 30 deletions.
62 changes: 61 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ jobs:
py -3 test\fuzz\test_runner.py --par %NUMBER_OF_PROCESSORS% --loglevel DEBUG %RUNNER_TEMP%\qa-assets\fuzz_corpora
windows-cross:
name: 'Windows cross, unit tests, no gui tests, no functional tests'
name: 'Windows cross, no tests'
runs-on: ubuntu-latest
if: ${{ vars.SKIP_BRANCH_PUSH != 'true' || github.event_name == 'pull_request' }}

Expand Down Expand Up @@ -303,6 +303,66 @@ jobs:
path: ${{ env.CCACHE_DIR }}
key: ${{ github.job }}-ccache-${{ github.run_id }}

- name: Upload built executables
uses: actions/upload-artifact@v4
with:
name: x86_64-w64-mingw32-executables-${{ github.run_id }}
path: |
${{ env.BASE_BUILD_DIR }}/src/**/*.exe
${{ env.BASE_BUILD_DIR }}/test/config.ini
windows-native-test:
name: 'Test on Windows'
runs-on: windows-2022
needs: windows-cross

env:
PYTHONUTF8: 1
TEST_RUNNER_TIMEOUT_FACTOR: 40

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Download built executables
uses: actions/download-artifact@v4
with:
name: x86_64-w64-mingw32-executables-${{ github.run_id }}

- name: Run bitcoind.exe
run: .\src\bitcoind.exe -version

- name: Run unit tests
run: |
.\src\test\test_bitcoin.exe -l test_suite
.\src\secp256k1\bin\exhaustive_tests.exe
.\src\secp256k1\bin\noverify_tests.exe
.\src\secp256k1\bin\tests.exe
.\src\univalue\object.exe
.\src\univalue\unitester.exe
- name: Run benchmarks
run: .\src\bench\bench_bitcoin.exe -sanity-check -priority-level=high

- name: Adjust paths in test\config.ini
run: |
(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"
Get-Content "test\config.ini"
- name: Run util tests
run: py -3 test\util\test_runner.py

- name: Run rpcauth test
run: py -3 test\util\rpcauth-test.py

- name: Run functional tests
env:
# TODO: Fix the excluded tests and re-enable them.
EXCLUDE: '--exclude wallet_migration.py,wallet_multiwallet.py'
TEST_RUNNER_EXTRA: ${{ github.event_name != 'pull_request' && '--extended' || '' }}
shell: cmd
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%

asan-lsan-ubsan-integer-no-depends-usdt:
name: 'ASan + LSan + UBSan + integer, no depends, USDT'
runs-on: ubuntu-24.04 # has to match container in ci/test/00_setup_env_native_asan.sh for tracing tools
Expand Down
7 changes: 2 additions & 5 deletions ci/test/00_setup_env_win64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,8 @@ export LC_ALL=C.UTF-8
export CONTAINER_NAME=ci_win64
export CI_IMAGE_NAME_TAG="docker.io/amd64/debian:bookworm" # Check that https://packages.debian.org/bookworm/g++-mingw-w64-x86-64-posix (version 12.2, similar to guix) can cross-compile
export HOST=x86_64-w64-mingw32
export DPKG_ADD_ARCH="i386"
export PACKAGES="nsis g++-mingw-w64-x86-64-posix wine-binfmt wine64 wine32 file"
# Install wine, but do not run unit tests, as they surface frequent
# false-positives.
export RUN_UNIT_TESTS=${RUN_UNIT_TESTS:-false}
export PACKAGES="g++-mingw-w64-x86-64-posix nsis"
export RUN_UNIT_TESTS=false
export RUN_FUNCTIONAL_TESTS=false
export GOAL="deploy"
# Prior to 11.0.0, the mingw-w64 headers were missing noreturn attributes, causing warnings when
Expand Down
4 changes: 0 additions & 4 deletions ci/test/03_test_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,6 @@ bash -c "${PRINT_CCACHE_STATISTICS}"
du -sh "${DEPENDS_DIR}"/*/
du -sh "${PREVIOUS_RELEASES_DIR}"

if [[ $HOST = *-mingw32 ]]; then
"${BASE_ROOT_DIR}/ci/test/wrap-wine.sh"
fi

if [ -n "$USE_VALGRIND" ]; then
"${BASE_ROOT_DIR}/ci/test/wrap-valgrind.sh"
fi
Expand Down
20 changes: 0 additions & 20 deletions ci/test/wrap-wine.sh

This file was deleted.

0 comments on commit 8331141

Please sign in to comment.