21
21
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
22
22
MAKEJOBS : ' -j10'
23
23
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
+
24
30
jobs :
25
31
test-each-commit :
26
32
name : ' test each commit'
@@ -150,7 +156,7 @@ jobs:
150
156
# https://github.com/actions/cache/blob/main/tips-and-workarounds.md#update-a-cache
151
157
key : ${{ github.job }}-${{ matrix.job-type }}-ccache-${{ github.run_id }}
152
158
153
- win64 -native :
159
+ windows -native :
154
160
name : ${{ matrix.job-name }}
155
161
# Use latest image, but hardcode version to avoid silent upgrades (and breaks).
156
162
# See: https://github.com/actions/runner-images#available-images.
@@ -169,10 +175,10 @@ jobs:
169
175
include :
170
176
- job-type : standard
171
177
generate-options : ' -DBUILD_GUI=ON -DWITH_BDB=ON -DWITH_ZMQ=ON -DBUILD_BENCH=ON -DWERROR=ON'
172
- job-name : ' Win64 native, VS 2022'
178
+ job-name : ' Windows native, VS 2022'
173
179
- job-type : fuzz
174
180
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'
181
+ job-name : ' Windows native, fuzz, VS 2022'
176
182
177
183
steps :
178
184
- name : Checkout
@@ -185,19 +191,20 @@ jobs:
185
191
arch : x64
186
192
187
193
- name : Get tool information
194
+ shell : pwsh
188
195
run : |
189
196
cmake -version | Tee-Object -FilePath "cmake_version"
190
197
Write-Output "---"
191
198
msbuild -version | Tee-Object -FilePath "msbuild_version"
192
199
$env:VCToolsVersion | Tee-Object -FilePath "toolset_version"
193
200
py -3 --version
194
201
Write-Host "PowerShell version $($PSVersionTable.PSVersion.ToString())"
202
+ bash --version
195
203
196
204
- name : Using vcpkg with MSBuild
197
205
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)"
206
+ echo "set(VCPKG_BUILD_TYPE release)" >> "${VCPKG_INSTALLATION_ROOT}/triplets/x64-windows.cmake"
207
+ echo "set(VCPKG_BUILD_TYPE release)" >> "${VCPKG_INSTALLATION_ROOT}/triplets/x64-windows-static.cmake"
201
208
202
209
- name : vcpkg tools cache
203
210
uses : actions/cache@v4
@@ -214,7 +221,7 @@ jobs:
214
221
215
222
- name : Generate build system
216
223
run : |
217
- cmake -B build --preset vs2022-static -DCMAKE_TOOLCHAIN_FILE="$env: VCPKG_INSTALLATION_ROOT\ scripts\ buildsystems\ vcpkg.cmake" ${{ matrix.generate-options }}
224
+ cmake -B build --preset vs2022-static -DCMAKE_TOOLCHAIN_FILE="${ VCPKG_INSTALLATION_ROOT}/ scripts/ buildsystems/ vcpkg.cmake" ${{ matrix.generate-options }}
218
225
219
226
- name : Save vcpkg binary cache
220
227
uses : actions/cache/save@v4
@@ -226,13 +233,13 @@ jobs:
226
233
- name : Build
227
234
working-directory : build
228
235
run : |
229
- cmake --build . -j $env: NUMBER_OF_PROCESSORS --config Release
236
+ cmake --build . -j $NUMBER_OF_PROCESSORS --config Release
230
237
231
238
- name : Run test suite
232
239
if : matrix.job-type == 'standard'
233
240
working-directory : build
234
241
run : |
235
- ctest --output-on-failure --stop-on-failure -j $env: NUMBER_OF_PROCESSORS -C Release
242
+ ctest --output-on-failure --stop-on-failure -j $NUMBER_OF_PROCESSORS -C Release
236
243
237
244
- name : Run functional tests
238
245
if : matrix.job-type == 'standard'
@@ -243,25 +250,130 @@ jobs:
243
250
BITCOINUTIL : ' ${{ github.workspace }}\build\bin\Release\bitcoin-util.exe'
244
251
BITCOINWALLET : ' ${{ github.workspace }}\build\bin\Release\bitcoin-wallet.exe'
245
252
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%
253
+ 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}
248
254
249
255
- name : Clone corpora
250
256
if : matrix.job-type == 'fuzz'
251
257
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 ..."
258
+ git clone --depth=1 https://github.com/bitcoin-core/qa-assets "${ RUNNER_TEMP}/ qa-assets"
259
+ cd "${ RUNNER_TEMP}/ qa-assets"
260
+ echo "Using qa-assets repo from commit ..."
255
261
git log -1
256
262
257
263
- name : Run fuzz tests
258
264
if : matrix.job-type == 'fuzz'
259
265
working-directory : build
260
266
env :
261
267
BITCOINFUZZ : ' ${{ github.workspace }}\build\bin\Release\fuzz.exe'
262
- shell : cmd
263
268
run : |
264
- py -3 test\fuzz\test_runner.py --par %NUMBER_OF_PROCESSORS% --loglevel DEBUG %RUNNER_TEMP%\qa-assets\fuzz_corpora
269
+ py -3 test/fuzz/test_runner.py --par $NUMBER_OF_PROCESSORS --loglevel DEBUG "${RUNNER_TEMP}/qa-assets/fuzz_corpora"
270
+
271
+ windows-cross :
272
+ name : ' Linux->Windows cross, no tests'
273
+ runs-on : ubuntu-latest
274
+ if : ${{ vars.SKIP_BRANCH_PUSH != 'true' || github.event_name == 'pull_request' }}
275
+
276
+ env :
277
+ FILE_ENV : ' ./ci/test/00_setup_env_win64.sh'
278
+ DANGER_CI_ON_HOST_FOLDERS : 1
279
+
280
+ steps :
281
+ - name : Checkout
282
+ uses : actions/checkout@v4
283
+
284
+ - name : Set CI directories
285
+ run : |
286
+ echo "CCACHE_DIR=${{ runner.temp }}/ccache_dir" >> "$GITHUB_ENV"
287
+ echo "BASE_ROOT_DIR=${{ runner.temp }}" >> "$GITHUB_ENV"
288
+ echo "DEPENDS_DIR=${{ runner.temp }}/depends" >> "$GITHUB_ENV"
289
+ echo "BASE_BUILD_DIR=${{ runner.temp }}/build" >> "$GITHUB_ENV"
290
+
291
+ - name : Depends cache
292
+ uses : actions/cache@v4
293
+ with :
294
+ path : ${{ env.DEPENDS_DIR }}/built
295
+ key : ${{ github.job }}-depends-${{ hashFiles('depends/**', 'ci/test/00_setup_env_win64.sh') }}
296
+
297
+ - name : Restore Ccache cache
298
+ id : ccache-cache
299
+ uses : actions/cache/restore@v4
300
+ with :
301
+ path : ${{ env.CCACHE_DIR }}
302
+ key : ${{ github.job }}-ccache-${{ github.run_id }}
303
+ restore-keys : ${{ github.job }}-ccache-
304
+
305
+ - name : CI script
306
+ run : ./ci/test_run_all.sh
307
+
308
+ - name : Save Ccache cache
309
+ uses : actions/cache/save@v4
310
+ if : github.event_name != 'pull_request' && steps.ccache-cache.outputs.cache-hit != 'true'
311
+ with :
312
+ path : ${{ env.CCACHE_DIR }}
313
+ key : ${{ github.job }}-ccache-${{ github.run_id }}
314
+
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
265
377
266
378
asan-lsan-ubsan-integer-no-depends-usdt :
267
379
name : ' ASan + LSan + UBSan + integer, no depends, USDT'
0 commit comments