2121 CI_FAILFAST_TEST_LEAVE_DANGLING : 1 # GHA does not care about dangling processes and setting this variable avoids killing the CI script itself on error
2222 MAKEJOBS : ' -j10'
2323
24+ defaults :
25+ run :
26+ # Enforce fail-fast behavior for all platforms.
27+ # See: https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference
28+ shell : bash
29+
2430jobs :
2531 test-each-commit :
2632 name : ' test each commit'
@@ -65,14 +71,17 @@ jobs:
6571 EXCLUDE_MERGE_BASE_ANCESTORS=^${MERGE_BASE}^@
6672 fi
6773 echo "TEST_BASE=$(git rev-list -n$((${{ env.MAX_COUNT }} + 1)) --reverse HEAD $EXCLUDE_MERGE_BASE_ANCESTORS | head -1)" >> "$GITHUB_ENV"
74+ - run : |
75+ git fetch origin "${GITHUB_BASE_REF}"
76+ git config user.email "ci@example.com"
77+ git config user.name "CI"
6878 - run : |
6979 sudo apt-get update
70- sudo apt-get install clang ccache build-essential cmake pkgconf python3-zmq libevent-dev libboost-dev libsqlite3-dev libdb++-dev systemtap-sdt-dev libzmq3-dev qtbase5- dev qttools5- dev qttools5-dev -tools qtwayland5 libqrencode-dev -y
80+ sudo apt-get install clang ccache build-essential cmake ninja-build pkgconf python3-zmq libevent-dev libboost-dev libsqlite3-dev systemtap-sdt-dev libzmq3-dev qt6-base- dev qt6-tools- dev qt6-l10n -tools libqrencode-dev -y
7181 - name : Compile and run tests
7282 run : |
7383 # Run tests on commits after the last merge commit and before the PR head commit
74- # Use clang++, because it is a bit faster and uses less memory than g++
75- git rebase --exec "echo Running test-one-commit on \$( git log -1 ) && CC=clang CXX=clang++ cmake -B build -DWERROR=ON -DWITH_ZMQ=ON -DBUILD_GUI=ON -DBUILD_BENCH=ON -DBUILD_FUZZ_BINARY=ON -DWITH_BDB=ON -DWITH_USDT=ON -DBUILD_KERNEL_LIB=ON -DBUILD_KERNEL_TEST=ON -DCMAKE_CXX_FLAGS='-Wno-error=unused-member-function' && cmake --build build -j $(nproc) && ctest --output-on-failure --stop-on-failure --test-dir build -j $(nproc) && ./build/test/functional/test_runner.py -j $(( $(nproc) * 2 )) --combinedlogslen=99999999" ${{ env.TEST_BASE }}
84+ git rebase --exec "git merge --no-commit origin/${GITHUB_BASE_REF} && ./.github/ci-test-each-commit-exec.sh && git reset --hard" ${{ env.TEST_BASE }}
7685
7786 macos-native-arm64 :
7887 name : ${{ matrix.job-name }}
@@ -124,7 +133,7 @@ jobs:
124133 run : |
125134 # A workaround for "The `brew link` step did not complete successfully" error.
126135 brew install --quiet python@3 || brew link --overwrite python@3
127- brew install --quiet coreutils ninja pkgconf gnu-getopt ccache boost libevent zeromq qt@5 qrencode
136+ brew install --quiet coreutils ninja pkgconf gnu-getopt ccache boost libevent zeromq qt@6 qrencode
128137
129138 - name : Set Ccache directory
130139 run : echo "CCACHE_DIR=${RUNNER_TEMP}/ccache_dir" >> "$GITHUB_ENV"
@@ -150,10 +159,8 @@ jobs:
150159 # https://github.com/actions/cache/blob/main/tips-and-workarounds.md#update-a-cache
151160 key : ${{ github.job }}-${{ matrix.job-type }}-ccache-${{ github.run_id }}
152161
153- win64 -native :
162+ windows -native-dll :
154163 name : ${{ matrix.job-name }}
155- # Use latest image, but hardcode version to avoid silent upgrades (and breaks).
156- # See: https://github.com/actions/runner-images#available-images.
157164 runs-on : windows-2022
158165
159166 if : ${{ vars.SKIP_BRANCH_PUSH != 'true' || github.event_name == 'pull_request' }}
@@ -168,11 +175,11 @@ jobs:
168175 job-type : [standard, fuzz]
169176 include :
170177 - job-type : standard
171- generate-options : ' -DBUILD_GUI=ON -DWITH_BDB=ON - DWITH_ZMQ=ON -DBUILD_BENCH=ON -DWERROR=ON - DBUILD_KERNEL_LIB=ON -DBUILD_UTIL_CHAINSTATE=ON -DBUILD_KERNEL_TEST=OFF'
172- job-name : ' Win64 native, VS 2022'
178+ generate-options : ' -DBUILD_GUI=ON -DWITH_ZMQ=ON -DBUILD_BENCH=ON -DBUILD_KERNEL_LIB=ON -DBUILD_UTIL_CHAINSTATE=ON -DBUILD_KERNEL_TEST=OFF -DWERROR=ON '
179+ job-name : ' Windows native, VS 2022'
173180 - job-type : fuzz
174181 generate-options : ' -DVCPKG_MANIFEST_NO_DEFAULT_FEATURES=ON -DVCPKG_MANIFEST_FEATURES="wallet" -DBUILD_GUI=OFF -DBUILD_FOR_FUZZING=ON -DWERROR=ON'
175- job-name : ' Win64 native fuzz, VS 2022'
182+ job-name : ' Windows native, fuzz, VS 2022'
176183
177184 steps :
178185 - name : Checkout
@@ -185,19 +192,21 @@ jobs:
185192 arch : x64
186193
187194 - name : Get tool information
195+ shell : pwsh
188196 run : |
189197 cmake -version | Tee-Object -FilePath "cmake_version"
190198 Write-Output "---"
191199 msbuild -version | Tee-Object -FilePath "msbuild_version"
192200 $env:VCToolsVersion | Tee-Object -FilePath "toolset_version"
193201 py -3 --version
194202 Write-Host "PowerShell version $($PSVersionTable.PSVersion.ToString())"
203+ bash --version
195204
196205 - name : Using vcpkg with MSBuild
197206 run : |
198- Set-Location "$env: VCPKG_INSTALLATION_ROOT"
199- Add-Content -Path "triplets\x64-windows.cmake" -Value "set(VCPKG_BUILD_TYPE release)"
200- Add-Content -Path "triplets\x64-windows-static.cmake" -Value " set(VCPKG_BUILD_TYPE release) "
207+ echo "set(VCPKG_BUILD_TYPE release)" >> "${ VCPKG_INSTALLATION_ROOT}/triplets/x64-windows.cmake "
208+ # Workaround for libevent, which requires CMake 3.1 but is incompatible with CMake >= 4.0.
209+ sed -i '1s/^/ set(ENV{CMAKE_POLICY_VERSION_MINIMUM} 3.5)\n/' "${VCPKG_INSTALLATION_ROOT}/scripts/ports.cmake "
201210
202211 - name : vcpkg tools cache
203212 uses : actions/cache@v4
@@ -214,7 +223,7 @@ jobs:
214223
215224 - name : Generate build system
216225 run : |
217- cmake -B build --preset vs2022-static -DCMAKE_TOOLCHAIN_FILE="$env: VCPKG_INSTALLATION_ROOT\ scripts\ buildsystems\ vcpkg.cmake" ${{ matrix.generate-options }}
226+ cmake -B build --preset vs2022 -DCMAKE_TOOLCHAIN_FILE="${ VCPKG_INSTALLATION_ROOT}/ scripts/ buildsystems/ vcpkg.cmake" ${{ matrix.generate-options }}
218227
219228 - name : Save vcpkg binary cache
220229 uses : actions/cache/save@v4
@@ -226,13 +235,24 @@ jobs:
226235 - name : Build
227236 working-directory : build
228237 run : |
229- cmake --build . -j $env:NUMBER_OF_PROCESSORS --config Release
238+ cmake --build . -j $NUMBER_OF_PROCESSORS --config Release
239+
240+ - name : Get bitcoind manifest
241+ if : matrix.job-type == 'standard'
242+ working-directory : build
243+ run : |
244+ mt.exe -nologo -inputresource:bin/Release/bitcoind.exe -out:bitcoind.manifest
245+ cat bitcoind.manifest
246+ echo
247+ mt.exe -nologo -inputresource:bin/Release/bitcoind.exe -validate_manifest
230248
231249 - name : Run test suite
232250 if : matrix.job-type == 'standard'
233251 working-directory : build
252+ env :
253+ QT_PLUGIN_PATH : ' ${{ github.workspace }}\build\vcpkg_installed\x64-windows\Qt6\plugins'
234254 run : |
235- ctest --output-on-failure --stop-on-failure -j $env: NUMBER_OF_PROCESSORS -C Release
255+ ctest --output-on-failure --stop-on-failure -j $NUMBER_OF_PROCESSORS -C Release
236256
237257 - name : Run functional tests
238258 if : matrix.job-type == 'standard'
@@ -242,26 +262,146 @@ jobs:
242262 BITCOINCLI : ' ${{ github.workspace }}\build\bin\Release\bitcoin-cli.exe'
243263 BITCOINUTIL : ' ${{ github.workspace }}\build\bin\Release\bitcoin-util.exe'
244264 BITCOINWALLET : ' ${{ github.workspace }}\build\bin\Release\bitcoin-wallet.exe'
265+ BITCOINCHAINSTATE : ' ${{ github.workspace }}\build\bin\Release\bitcoin-chainstate.exe'
245266 TEST_RUNNER_EXTRA : ${{ github.event_name != 'pull_request' && '--extended' || '' }}
246- shell : cmd
247- 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% %TEST_RUNNER_EXTRA%
267+ 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} ${TEST_RUNNER_EXTRA}
248268
249269 - name : Clone corpora
250270 if : matrix.job-type == 'fuzz'
251271 run : |
252- git clone --depth=1 https://github.com/bitcoin-core/qa-assets "$env: RUNNER_TEMP\ qa-assets"
253- Set-Location "$env: RUNNER_TEMP\ qa-assets"
254- Write-Host "Using qa-assets repo from commit ..."
272+ git clone --depth=1 https://github.com/bitcoin-core/qa-assets "${ RUNNER_TEMP}/ qa-assets"
273+ cd "${ RUNNER_TEMP}/ qa-assets"
274+ echo "Using qa-assets repo from commit ..."
255275 git log -1
256276
257277 - name : Run fuzz tests
258278 if : matrix.job-type == 'fuzz'
259279 working-directory : build
260280 env :
261281 BITCOINFUZZ : ' ${{ github.workspace }}\build\bin\Release\fuzz.exe'
262- shell : cmd
263282 run : |
264- py -3 test\fuzz\test_runner.py --par %NUMBER_OF_PROCESSORS% --loglevel DEBUG %RUNNER_TEMP%\qa-assets\fuzz_corpora
283+ py -3 test/fuzz/test_runner.py --par $NUMBER_OF_PROCESSORS --loglevel DEBUG "${RUNNER_TEMP}/qa-assets/fuzz_corpora"
284+
285+ windows-cross :
286+ name : ' Linux->Windows cross, no tests'
287+ runs-on : ubuntu-latest
288+ if : ${{ vars.SKIP_BRANCH_PUSH != 'true' || github.event_name == 'pull_request' }}
289+
290+ env :
291+ FILE_ENV : ' ./ci/test/00_setup_env_win64.sh'
292+ DANGER_CI_ON_HOST_FOLDERS : 1
293+
294+ steps :
295+ - name : Checkout
296+ uses : actions/checkout@v4
297+
298+ - name : Set CI directories
299+ run : |
300+ echo "CCACHE_DIR=${{ runner.temp }}/ccache_dir" >> "$GITHUB_ENV"
301+ echo "BASE_ROOT_DIR=${{ runner.temp }}" >> "$GITHUB_ENV"
302+ echo "DEPENDS_DIR=${{ runner.temp }}/depends" >> "$GITHUB_ENV"
303+ echo "BASE_BUILD_DIR=${{ runner.temp }}/build" >> "$GITHUB_ENV"
304+
305+ - name : Depends cache
306+ uses : actions/cache@v4
307+ with :
308+ path : ${{ env.DEPENDS_DIR }}/built
309+ key : ${{ github.job }}-depends-${{ hashFiles('depends/**', 'ci/test/00_setup_env_win64.sh') }}
310+
311+ - name : Restore Ccache cache
312+ id : ccache-cache
313+ uses : actions/cache/restore@v4
314+ with :
315+ path : ${{ env.CCACHE_DIR }}
316+ key : ${{ github.job }}-ccache-${{ github.run_id }}
317+ restore-keys : ${{ github.job }}-ccache-
318+
319+ - name : CI script
320+ run : ./ci/test_run_all.sh
321+
322+ - name : Save Ccache cache
323+ uses : actions/cache/save@v4
324+ if : github.event_name != 'pull_request' && steps.ccache-cache.outputs.cache-hit != 'true'
325+ with :
326+ path : ${{ env.CCACHE_DIR }}
327+ key : ${{ github.job }}-ccache-${{ github.run_id }}
328+
329+ - name : Upload built executables
330+ uses : actions/upload-artifact@v4
331+ with :
332+ name : x86_64-w64-mingw32-executables-${{ github.run_id }}
333+ path : |
334+ ${{ env.BASE_BUILD_DIR }}/bin/*.exe
335+ ${{ env.BASE_BUILD_DIR }}/src/secp256k1/bin/*.exe
336+ ${{ env.BASE_BUILD_DIR }}/src/univalue/*.exe
337+ ${{ env.BASE_BUILD_DIR }}/test/config.ini
338+
339+ windows-native-test :
340+ name : ' Windows, test cross-built'
341+ runs-on : windows-2022
342+ needs : windows-cross
343+
344+ env :
345+ PYTHONUTF8 : 1
346+ TEST_RUNNER_TIMEOUT_FACTOR : 40
347+
348+ steps :
349+ - name : Checkout
350+ uses : actions/checkout@v4
351+
352+ - name : Download built executables
353+ uses : actions/download-artifact@v4
354+ with :
355+ name : x86_64-w64-mingw32-executables-${{ github.run_id }}
356+
357+ - name : Run bitcoind.exe
358+ run : ./bin/bitcoind.exe -version
359+
360+ - name : Find mt.exe tool
361+ shell : pwsh
362+ run : |
363+ $sdk_dir = (Get-ItemProperty 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows Kits\Installed Roots' -Name KitsRoot10).KitsRoot10
364+ $sdk_latest = (Get-ChildItem "$sdk_dir\bin" -Directory | Where-Object { $_.Name -match '^\d+\.\d+\.\d+\.\d+$' } | Sort-Object Name -Descending | Select-Object -First 1).Name
365+ "MT_EXE=${sdk_dir}bin\${sdk_latest}\x64\mt.exe" >> $env:GITHUB_ENV
366+
367+ - name : Get bitcoind manifest
368+ shell : pwsh
369+ run : |
370+ & $env:MT_EXE -nologo -inputresource:bin\bitcoind.exe -out:bitcoind.manifest
371+ Get-Content bitcoind.manifest
372+ & $env:MT_EXE -nologo -inputresource:bin\bitcoind.exe -validate_manifest
373+
374+ - name : Run unit tests
375+ # Can't use ctest here like other jobs as we don't have a CMake build tree.
376+ run : |
377+ ./bin/test_bitcoin.exe -l test_suite
378+ ./src/secp256k1/bin/exhaustive_tests.exe
379+ ./src/secp256k1/bin/noverify_tests.exe
380+ ./src/secp256k1/bin/tests.exe
381+ ./src/univalue/object.exe
382+ ./src/univalue/unitester.exe
383+
384+ - name : Run benchmarks
385+ run : ./bin/bench_bitcoin.exe -sanity-check
386+
387+ - name : Adjust paths in test/config.ini
388+ shell : pwsh
389+ run : |
390+ (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"
391+ Get-Content "test/config.ini"
392+
393+ - name : Run util tests
394+ run : py -3 test/util/test_runner.py
395+
396+ - name : Run rpcauth test
397+ run : py -3 test/util/rpcauth-test.py
398+
399+ - name : Run functional tests
400+ env :
401+ # TODO: Fix the excluded test and re-enable it.
402+ EXCLUDE : ' --exclude wallet_multiwallet.py'
403+ TEST_RUNNER_EXTRA : ${{ github.event_name != 'pull_request' && '--extended' || '' }}
404+ 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
265405
266406 asan-lsan-ubsan-integer-no-depends-usdt :
267407 name : ' ASan + LSan + UBSan + integer, no depends, USDT'
0 commit comments