mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 23:09:44 -04:00
Update ci.yml
This commit is contained in:
parent
2b168a9a55
commit
ffa0d89099
1 changed files with 406 additions and 315 deletions
717
.github/workflows/ci.yml
vendored
717
.github/workflows/ci.yml
vendored
|
@ -1,348 +1,439 @@
|
||||||
#!/usr/bin/env python3
|
# Copyright (c) 2023-present The Bitcoin Core developers
|
||||||
#
|
|
||||||
# Copyright (c) 2018-present The Bitcoin Core developers
|
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
#
|
|
||||||
# Download or build previous releases.
|
|
||||||
# Needs curl and tar to download a release, or the build dependencies when
|
|
||||||
# building a release.
|
|
||||||
|
|
||||||
import argparse
|
name: CI
|
||||||
import contextlib
|
on:
|
||||||
from fnmatch import fnmatch
|
# See: https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#pull_request.
|
||||||
import os
|
pull_request:
|
||||||
from pathlib import Path
|
# See: https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#push.
|
||||||
import re
|
push:
|
||||||
import shutil
|
branches:
|
||||||
import subprocess
|
- '**'
|
||||||
import sys
|
tags-ignore:
|
||||||
import hashlib
|
- '**'
|
||||||
|
|
||||||
SHA256_SUMS = {
|
concurrency:
|
||||||
"0e2819135366f150d9906e294b61dff58fd1996ebd26c2f8e979d6c0b7a79580": {"tag": "v0.14.3", "tarball": "bitcoin-0.14.3-aarch64-linux-gnu.tar.gz"},
|
group: ${{ github.event_name != 'pull_request' && github.run_id || github.ref }}
|
||||||
"d86fc90824a85c38b25c8488115178d5785dbc975f5ff674f9f5716bc8ad6e65": {"tag": "v0.14.3", "tarball": "bitcoin-0.14.3-arm-linux-gnueabihf.tar.gz"},
|
cancel-in-progress: true
|
||||||
"1b0a7408c050e3d09a8be8e21e183ef7ee570385dc41216698cc3ab392a484e7": {"tag": "v0.14.3", "tarball": "bitcoin-0.14.3-osx64.tar.gz"},
|
|
||||||
"706e0472dbc933ed2757650d54cbcd780fd3829ebf8f609b32780c7eedebdbc9": {"tag": "v0.14.3", "tarball": "bitcoin-0.14.3-x86_64-linux-gnu.tar.gz"},
|
env:
|
||||||
"11ba15c0e933f19c33cf6d111c7808346d8a0b80f64969b69de610883bacf880": {"tag": "v0.14.3", "tarball": "bitcoin-0.14.3-win64.zip"},
|
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
|
||||||
|
MAKEJOBS: '-j10'
|
||||||
|
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
# Enforce fail-fast behavior for all platforms.
|
||||||
|
# See: https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test-each-commit:
|
||||||
|
name: 'test each commit'
|
||||||
|
runs-on: ubuntu-24.04
|
||||||
|
if: github.event_name == 'pull_request' && github.event.pull_request.commits != 1
|
||||||
|
timeout-minutes: 360 # Use maximum time, see https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#jobsjob_idtimeout-minutes. Assuming a worst case time of 1 hour per commit, this leads to a --max-count=6 below.
|
||||||
|
env:
|
||||||
|
MAX_COUNT: 6
|
||||||
|
steps:
|
||||||
|
- name: Determine fetch depth
|
||||||
|
run: echo "FETCH_DEPTH=$((${{ github.event.pull_request.commits }} + 2))" >> "$GITHUB_ENV"
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
|
fetch-depth: ${{ env.FETCH_DEPTH }}
|
||||||
|
- name: Determine commit range
|
||||||
|
run: |
|
||||||
|
# Checkout HEAD~ and find the test base commit
|
||||||
|
# Checkout HEAD~ because it would be wasteful to rerun tests on the PR
|
||||||
|
# head commit that are already run by other jobs.
|
||||||
|
git checkout HEAD~
|
||||||
|
# Figure out test base commit by listing ancestors of HEAD, excluding
|
||||||
|
# ancestors of the most recent merge commit, limiting the list to the
|
||||||
|
# newest MAX_COUNT ancestors, ordering it from oldest to newest, and
|
||||||
|
# taking the first one.
|
||||||
#
|
#
|
||||||
"d40f18b4e43c6e6370ef7db9131f584fbb137276ec2e3dba67a4b267f81cb644": {"tag": "v0.15.2", "tarball": "bitcoin-0.15.2-aarch64-linux-gnu.tar.gz"},
|
# If the branch contains up to MAX_COUNT ancestor commits after the
|
||||||
"54fb877a148a6ad189a1e1ab1ff8b11181e58ff2aaf430da55b3fd46ae549a6b": {"tag": "v0.15.2", "tarball": "bitcoin-0.15.2-arm-linux-gnueabihf.tar.gz"},
|
# most recent merge commit, all of those commits will be tested. If it
|
||||||
"87e9340ff3d382d543b2b69112376077f0c8b4f7450d372e83b68f5a1e22b2df": {"tag": "v0.15.2", "tarball": "bitcoin-0.15.2-osx64.tar.gz"},
|
# contains more, only the most recent MAX_COUNT commits will be
|
||||||
"566be44190fd76daa01f13d428939dadfb8e3daacefc8fa17f433cad28f73bd5": {"tag": "v0.15.2", "tarball": "bitcoin-0.15.2-x86_64-linux-gnu.tar.gz"},
|
# tested.
|
||||||
"42c9f86e89e75f3c537ce5e7d9afab782048201afbf808c7e7d54db5474fec81": {"tag": "v0.15.2", "tarball": "bitcoin-0.15.2-win64.zip"},
|
|
||||||
#
|
#
|
||||||
"0768c6c15caffbaca6524824c9563b42c24f70633c681c2744649158aa3fd484": {"tag": "v0.16.3", "tarball": "bitcoin-0.16.3-aarch64-linux-gnu.tar.gz"},
|
# In the command below, the ^@ suffix is used to refer to all parents
|
||||||
"fb2818069854a6ad20ea03b28b55dbd35d8b1f7d453e90b83eace5d0098a2a87": {"tag": "v0.16.3", "tarball": "bitcoin-0.16.3-arm-linux-gnueabihf.tar.gz"},
|
# of the merge commit as described in:
|
||||||
"78c3bff3b619a19aed575961ea43cc9e142959218835cf51aede7f0b764fc25d": {"tag": "v0.16.3", "tarball": "bitcoin-0.16.3-osx64.tar.gz"},
|
# https://git-scm.com/docs/git-rev-parse#_other_rev_parent_shorthand_notations
|
||||||
"5d422a9d544742bc0df12427383f9c2517433ce7b58cf672b9a9b17c2ef51e4f": {"tag": "v0.16.3", "tarball": "bitcoin-0.16.3-x86_64-linux-gnu.tar.gz"},
|
# and the ^ prefix is used to exclude these parents and all their
|
||||||
"691ba37858e6ec0bcd02abca271cfc6d81206305e259458c1a1e8e9d1ba1dd75": {"tag": "v0.16.3", "tarball": "bitcoin-0.16.3-win64.zip"},
|
# ancestors from the rev-list output as described in:
|
||||||
#
|
# https://git-scm.com/docs/git-rev-list
|
||||||
"5a6b35d1a348a402f2d2d6ab5aed653a1a1f13bc63aaaf51605e3501b0733b7a": {"tag": "v0.17.2", "tarball": "bitcoin-0.17.2-aarch64-linux-gnu.tar.gz"},
|
MERGE_BASE=$(git rev-list -n1 --merges HEAD)
|
||||||
"d1913a5d19c8e8da4a67d1bd5205d03c8614dfd2e02bba2fe3087476643a729e": {"tag": "v0.17.2", "tarball": "bitcoin-0.17.2-arm-linux-gnueabihf.tar.gz"},
|
EXCLUDE_MERGE_BASE_ANCESTORS=
|
||||||
"a783ba20706dbfd5b47fbedf42165fce70fbbc7d78003305d964f6b3da14887f": {"tag": "v0.17.2", "tarball": "bitcoin-0.17.2-osx64.tar.gz"},
|
# MERGE_BASE can be empty due to limited fetch-depth
|
||||||
"943f9362b9f11130177839116f48f809d83478b4c28591d486ee9a7e35179da6": {"tag": "v0.17.2", "tarball": "bitcoin-0.17.2-x86_64-linux-gnu.tar.gz"},
|
if test -n "$MERGE_BASE"; then
|
||||||
"9385735a428c5d2d2ddbc569b6eac06baf93c39ed21d91722a337a6f7e645ca7": {"tag": "v0.17.2", "tarball": "bitcoin-0.17.2-win64.zip"},
|
EXCLUDE_MERGE_BASE_ANCESTORS=^${MERGE_BASE}^@
|
||||||
#
|
fi
|
||||||
"88f343af72803b851c7da13874cc5525026b0b55e63e1b5e1298390c4688adc6": {"tag": "v0.18.1", "tarball": "bitcoin-0.18.1-aarch64-linux-gnu.tar.gz"},
|
echo "TEST_BASE=$(git rev-list -n$((${{ env.MAX_COUNT }} + 1)) --reverse HEAD $EXCLUDE_MERGE_BASE_ANCESTORS | head -1)" >> "$GITHUB_ENV"
|
||||||
"cc7d483e4b20c5dabd4dcaf304965214cf4934bcc029ca99cbc9af00d3771a1f": {"tag": "v0.18.1", "tarball": "bitcoin-0.18.1-arm-linux-gnueabihf.tar.gz"},
|
- run: |
|
||||||
"b7bbcee7a7540f711b171d6981f939ca8482005fde22689bc016596d80548bb1": {"tag": "v0.18.1", "tarball": "bitcoin-0.18.1-osx64.tar.gz"},
|
git fetch origin "${GITHUB_BASE_REF}"
|
||||||
"425ee5ec631ae8da71ebc1c3f5c0269c627cf459379b9b030f047107a28e3ef8": {"tag": "v0.18.1", "tarball": "bitcoin-0.18.1-riscv64-linux-gnu.tar.gz"},
|
git config user.email "ci@example.com"
|
||||||
"600d1db5e751fa85903e935a01a74f5cc57e1e7473c15fd3e17ed21e202cfe5a": {"tag": "v0.18.1", "tarball": "bitcoin-0.18.1-x86_64-linux-gnu.tar.gz"},
|
git config user.name "CI"
|
||||||
"3bac0674c0786689167be2b9f35d2d6e91d5f44e43ee6c0a9113a19d999d4070": {"tag": "v0.18.1", "tarball": "bitcoin-0.18.1-win64.zip"},
|
- run: |
|
||||||
#
|
sudo apt-get update
|
||||||
"3a80431717842672df682bdb619e66523b59541483297772a7969413be3502ff": {"tag": "v0.19.1", "tarball": "bitcoin-0.19.1-aarch64-linux-gnu.tar.gz"},
|
sudo apt-get install clang ccache build-essential cmake ninja-build pkgconf python3-zmq libevent-dev libboost-dev libsqlite3-dev libdb++-dev systemtap-sdt-dev libzmq3-dev qt6-base-dev qt6-tools-dev qt6-l10n-tools libqrencode-dev -y
|
||||||
"657f28213823d240dd3324d14829702f9ad6f0710f8bdd1c379cb3c447197f48": {"tag": "v0.19.1", "tarball": "bitcoin-0.19.1-arm-linux-gnueabihf.tar.gz"},
|
- name: Compile and run tests
|
||||||
"1ae1b87de26487075cd2fd22e0d4ead87d969bd55c44f2f1d873ecdc6147ebb3": {"tag": "v0.19.1", "tarball": "bitcoin-0.19.1-osx64.tar.gz"},
|
run: |
|
||||||
"aa7a9563b48aa79252c8e7b6a41c07a5441bd9f14c5e4562cc72720ea6cb0ee5": {"tag": "v0.19.1", "tarball": "bitcoin-0.19.1-riscv64-linux-gnu.tar.gz"},
|
# Run tests on commits after the last merge commit and before the PR head commit
|
||||||
"5fcac9416e486d4960e1a946145566350ca670f9aaba99de6542080851122e4c": {"tag": "v0.19.1", "tarball": "bitcoin-0.19.1-x86_64-linux-gnu.tar.gz"},
|
git rebase --exec "git merge --no-commit origin/${GITHUB_BASE_REF} && ./.github/ci-test-each-commit-exec.sh && git reset --hard" ${{ env.TEST_BASE }}
|
||||||
"7706593de727d893e4b1bab084d6df61a6f8a37dcc9e0c2c6c83b02417b321ad": {"tag": "v0.19.1", "tarball": "bitcoin-0.19.1-win64.zip"},
|
|
||||||
#
|
|
||||||
"60c93e3462c303eb080be7cf623f1a7684b37fd47a018ad3848bc23e13c84e1c": {"tag": "v0.20.1", "tarball": "bitcoin-0.20.1-aarch64-linux-gnu.tar.gz"},
|
|
||||||
"55b577e0fb306fb429d4be6c9316607753e8543e5946b542d75d876a2f08654c": {"tag": "v0.20.1", "tarball": "bitcoin-0.20.1-arm-linux-gnueabihf.tar.gz"},
|
|
||||||
"b9024dde373ea7dad707363e07ec7e265383204127539ae0c234bff3a61da0d1": {"tag": "v0.20.1", "tarball": "bitcoin-0.20.1-osx64.tar.gz"},
|
|
||||||
"fa71cb52ee5e0459cbf5248cdec72df27995840c796f58b304607a1ed4c165af": {"tag": "v0.20.1", "tarball": "bitcoin-0.20.1-riscv64-linux-gnu.tar.gz"},
|
|
||||||
"376194f06596ecfa40331167c39bc70c355f960280bd2a645fdbf18f66527397": {"tag": "v0.20.1", "tarball": "bitcoin-0.20.1-x86_64-linux-gnu.tar.gz"},
|
|
||||||
"398d55c9d83a257a947f53ef7b1d83c4e9dae72f33c3cc6157dfa6f8ffd5a4e4": {"tag": "v0.20.1", "tarball": "bitcoin-0.20.1-win64.zip"},
|
|
||||||
|
|
||||||
"43416854330914992bbba2d0e9adf2a6fff4130be9af8ae2ef1186e743d9a3fe": {"tag": "v0.21.0", "tarball": "bitcoin-0.21.0-aarch64-linux-gnu.tar.gz"},
|
macos-native-arm64:
|
||||||
"f028af308eda45a3c4c90f9332f96b075bf21e3495c945ebce48597151808176": {"tag": "v0.21.0", "tarball": "bitcoin-0.21.0-arm-linux-gnueabihf.tar.gz"},
|
name: ${{ matrix.job-name }}
|
||||||
"695fb624fa6423f5da4f443b60763dd1d77488bfe5ef63760904a7b54e91298d": {"tag": "v0.21.0", "tarball": "bitcoin-0.21.0-osx64.tar.gz"},
|
# Use any image to support the xcode-select below, but hardcode version to avoid silent upgrades (and breaks).
|
||||||
"f8b2adfeae021a672effbc7bd40d5c48d6b94e53b2dd660f787340bf1a52e4e9": {"tag": "v0.21.0", "tarball": "bitcoin-0.21.0-riscv64-linux-gnu.tar.gz"},
|
# See: https://github.com/actions/runner-images#available-images.
|
||||||
"da7766775e3f9c98d7a9145429f2be8297c2672fe5b118fd3dc2411fb48e0032": {"tag": "v0.21.0", "tarball": "bitcoin-0.21.0-x86_64-linux-gnu.tar.gz"},
|
runs-on: macos-14
|
||||||
"499c28df33a824cfd4a0d727a154b50862d4238e4ba5fd9ac094a6c995ed825e": {"tag": "v0.21.0", "tarball": "bitcoin-0.21.0-win64.zip"},
|
|
||||||
|
|
||||||
"ac718fed08570a81b3587587872ad85a25173afa5f9fbbd0c03ba4d1714cfa3e": {"tag": "v22.0", "tarball": "bitcoin-22.0-aarch64-linux-gnu.tar.gz"},
|
# When a contributor maintains a fork of the repo, any pull request they make
|
||||||
"b8713c6c5f03f5258b54e9f436e2ed6d85449aa24c2c9972f91963d413e86311": {"tag": "v22.0", "tarball": "bitcoin-22.0-arm-linux-gnueabihf.tar.gz"},
|
# to their own fork, or to the main repository, will trigger two CI runs:
|
||||||
"2744d199c3343b2d94faffdfb2c94d75a630ba27301a70e47b0ad30a7e0155e9": {"tag": "v22.0", "tarball": "bitcoin-22.0-osx64.tar.gz"},
|
# one for the branch push and one for the pull request.
|
||||||
"2cca5f99007d060aca9d8c7cbd035dfe2f040dd8200b210ce32cdf858479f70d": {"tag": "v22.0", "tarball": "bitcoin-22.0-powerpc64-linux-gnu.tar.gz"},
|
# This can be avoided by setting SKIP_BRANCH_PUSH=true as a custom env variable
|
||||||
"91b1e012975c5a363b5b5fcc81b5b7495e86ff703ec8262d4b9afcfec633c30d": {"tag": "v22.0", "tarball": "bitcoin-22.0-powerpc64le-linux-gnu.tar.gz"},
|
# in Github repository settings.
|
||||||
"9cc3a62c469fe57e11485fdd32c916f10ce7a2899299855a2e479256ff49ff3c": {"tag": "v22.0", "tarball": "bitcoin-22.0-riscv64-linux-gnu.tar.gz"},
|
if: ${{ vars.SKIP_BRANCH_PUSH != 'true' || github.event_name == 'pull_request' }}
|
||||||
"59ebd25dd82a51638b7a6bb914586201e67db67b919b2a1ff08925a7936d1b16": {"tag": "v22.0", "tarball": "bitcoin-22.0-x86_64-linux-gnu.tar.gz"},
|
|
||||||
"bff531650dcf859c27d8428dc5f98f3f93d9b6d54e4c1401e0ea9651f1edd7a3": {"tag": "v22.0", "tarball": "bitcoin-22.0-win64.zip"},
|
|
||||||
|
|
||||||
"06f4c78271a77752ba5990d60d81b1751507f77efda1e5981b4e92fd4d9969fb": {"tag": "v23.0", "tarball": "bitcoin-23.0-aarch64-linux-gnu.tar.gz"},
|
timeout-minutes: 120
|
||||||
"952c574366aff76f6d6ad1c9ee45a361d64fa04155e973e926dfe7e26f9703a3": {"tag": "v23.0", "tarball": "bitcoin-23.0-arm-linux-gnueabihf.tar.gz"},
|
|
||||||
"7c8bc63731aa872b7b334a8a7d96e33536ad77d49029bad179b09dca32cd77ac": {"tag": "v23.0", "tarball": "bitcoin-23.0-arm64-apple-darwin.tar.gz"},
|
|
||||||
"2caa5898399e415f61d9af80a366a3008e5856efa15aaff74b88acf429674c99": {"tag": "v23.0", "tarball": "bitcoin-23.0-powerpc64-linux-gnu.tar.gz"},
|
|
||||||
"217dd0469d0f4962d22818c368358575f6a0abcba8804807bb75325eb2f28b19": {"tag": "v23.0", "tarball": "bitcoin-23.0-powerpc64le-linux-gnu.tar.gz"},
|
|
||||||
"078f96b1e92895009c798ab827fb3fde5f6719eee886bd0c0e93acab18ea4865": {"tag": "v23.0", "tarball": "bitcoin-23.0-riscv64-linux-gnu.tar.gz"},
|
|
||||||
"c816780583009a9dad426dc0c183c89be9da98906e1e2c7ebae91041c1aaaaf3": {"tag": "v23.0", "tarball": "bitcoin-23.0-x86_64-apple-darwin.tar.gz"},
|
|
||||||
"2cca490c1f2842884a3c5b0606f179f9f937177da4eadd628e3f7fd7e25d26d0": {"tag": "v23.0", "tarball": "bitcoin-23.0-x86_64-linux-gnu.tar.gz"},
|
|
||||||
"e16fdbdc4ee953969df1ce8f82380e9c61658b1a64801bd21e2e87063e93bc6a": {"tag": "v23.0", "tarball": "bitcoin-23.0-win64.zip"},
|
|
||||||
|
|
||||||
"0b48b9e69b30037b41a1e6b78fb7cbcc48c7ad627908c99686e81f3802454609": {"tag": "v24.0.1", "tarball": "bitcoin-24.0.1-aarch64-linux-gnu.tar.gz"},
|
strategy:
|
||||||
"37d7660f0277301744e96426bbb001d2206b8d4505385dfdeedf50c09aaaef60": {"tag": "v24.0.1", "tarball": "bitcoin-24.0.1-arm-linux-gnueabihf.tar.gz"},
|
fail-fast: false
|
||||||
"90ed59e86bfda1256f4b4cad8cc1dd77ee0efec2492bcb5af61402709288b62c": {"tag": "v24.0.1", "tarball": "bitcoin-24.0.1-arm64-apple-darwin.tar.gz"},
|
matrix:
|
||||||
"7590645e8676f8b5fda62dc20174474c4ac8fd0defc83a19ed908ebf2e94dc11": {"tag": "v24.0.1", "tarball": "bitcoin-24.0.1-powerpc64-linux-gnu.tar.gz"},
|
job-type: [standard, fuzz]
|
||||||
"79e89a101f23ff87816675b98769cd1ee91059f95c5277f38f48f21a9f7f8509": {"tag": "v24.0.1", "tarball": "bitcoin-24.0.1-powerpc64le-linux-gnu.tar.gz"},
|
include:
|
||||||
"6b163cef7de4beb07b8cb3347095e0d76a584019b1891135cd1268a1f05b9d88": {"tag": "v24.0.1", "tarball": "bitcoin-24.0.1-riscv64-linux-gnu.tar.gz"},
|
- job-type: standard
|
||||||
"e2f751512f3c0f00eb68ba946d9c829e6cf99422a61e8f5e0a7c109c318674d0": {"tag": "v24.0.1", "tarball": "bitcoin-24.0.1-x86_64-apple-darwin.tar.gz"},
|
file-env: './ci/test/00_setup_env_mac_native.sh'
|
||||||
"49df6e444515d457ea0b885d66f521f2a26ca92ccf73d5296082e633544253bf": {"tag": "v24.0.1", "tarball": "bitcoin-24.0.1-x86_64-linux-gnu.tar.gz"},
|
job-name: 'macOS 14 native, arm64, no depends, sqlite only, gui'
|
||||||
"97de6e2a4d91531c057537e83bb7e72b1cf9ab777601eb481f3f4a6d9e7b9c67": {"tag": "v24.0.1", "tarball": "bitcoin-24.0.1-win64.zip"},
|
- job-type: fuzz
|
||||||
|
file-env: './ci/test/00_setup_env_mac_native_fuzz.sh'
|
||||||
|
job-name: 'macOS 14 native, arm64, fuzz'
|
||||||
|
|
||||||
"3a7bdd959a0b426624f63f394f25e5b7769a5a2f96f8126dcc2ea53f3fa5212b": {"tag": "v25.0", "tarball": "bitcoin-25.0-aarch64-linux-gnu.tar.gz"},
|
env:
|
||||||
"e537c8630b05e63242d979c3004f851fd73c2a10b5b4fdbb161788427c7b3c0f": {"tag": "v25.0", "tarball": "bitcoin-25.0-arm-linux-gnueabihf.tar.gz"},
|
DANGER_RUN_CI_ON_HOST: 1
|
||||||
"3b35075d6c1209743611c705a13575be2668bc069bc6301ce78a2e1e53ebe7cc": {"tag": "v25.0", "tarball": "bitcoin-25.0-arm64-apple-darwin.tar.gz"},
|
BASE_ROOT_DIR: ${{ github.workspace }}
|
||||||
"0c8e135a6fd297270d3b65196042d761453493a022b5ff7fb847fc911e938214": {"tag": "v25.0", "tarball": "bitcoin-25.0-powerpc64-linux-gnu.tar.gz"},
|
|
||||||
"fa8af160782f5adfcea570f72b947073c1663b3e9c3cd0f82b216b609fe47573": {"tag": "v25.0", "tarball": "bitcoin-25.0-powerpc64le-linux-gnu.tar.gz"},
|
|
||||||
"fe6e347a66043946920c72c9c4afca301968101e6b82fb90a63d7885ebcceb32": {"tag": "v25.0", "tarball": "bitcoin-25.0-riscv64-linux-gnu.tar.gz"},
|
|
||||||
"5708fc639cdfc27347cccfd50db9b73b53647b36fb5f3a4a93537cbe8828c27f": {"tag": "v25.0", "tarball": "bitcoin-25.0-x86_64-apple-darwin.tar.gz"},
|
|
||||||
"33930d432593e49d58a9bff4c30078823e9af5d98594d2935862788ce8a20aec": {"tag": "v25.0", "tarball": "bitcoin-25.0-x86_64-linux-gnu.tar.gz"},
|
|
||||||
"c0d22e9d37d0238215676af1c4e358c8af3a43fe7a25c57499b4c66ca80381da": {"tag": "v25.0", "tarball": "bitcoin-25.0-win64.zip"},
|
|
||||||
|
|
||||||
"7fa582d99a25c354d23e371a5848bd9e6a79702870f9cbbf1292b86e647d0f4e": {"tag": "v28.0", "tarball": "bitcoin-28.0-aarch64-linux-gnu.tar.gz"},
|
steps:
|
||||||
"e004b7910bedd6dd18b6c52b4eef398d55971da666487a82cd48708d2879727e": {"tag": "v28.0", "tarball": "bitcoin-28.0-arm-linux-gnueabihf.tar.gz"},
|
- name: Checkout
|
||||||
"c8108f30dfcc7ddffab33f5647d745414ef9d3298bfe67d243fe9b9cb4df4c12": {"tag": "v28.0", "tarball": "bitcoin-28.0-arm64-apple-darwin.tar.gz"},
|
uses: actions/checkout@v4
|
||||||
"756df50d8f0c2a3d4111389a7be5f4849e0f5014dd5bfcbc37a8c3aaaa54907b": {"tag": "v28.0", "tarball": "bitcoin-28.0-powerpc64-linux-gnu.tar.gz"},
|
|
||||||
"6ee1a520b638132a16725020146abea045db418ce91c02493f02f541cd53062a": {"tag": "v28.0", "tarball": "bitcoin-28.0-riscv64-linux-gnu.tar.gz"},
|
|
||||||
"77e931bbaaf47771a10c376230bf53223f5380864bad3568efc7f4d02e40a0f7": {"tag": "v28.0", "tarball": "bitcoin-28.0-x86_64-apple-darwin.tar.gz"},
|
|
||||||
"7fe294b02b25b51acb8e8e0a0eb5af6bbafa7cd0c5b0e5fcbb61263104a82fbc": {"tag": "v28.0", "tarball": "bitcoin-28.0-x86_64-linux-gnu.tar.gz"},
|
|
||||||
"f2974a7df505cff14ca92dd7a23ba7e47f1b97ae7e7a12a6fc2f5f5c0a66ca10": {"tag": "v28.0", "tarball": "bitcoin-28.0-win64.zip"},
|
|
||||||
}
|
|
||||||
|
|
||||||
|
- name: Clang version
|
||||||
|
run: |
|
||||||
|
# Use the earliest Xcode supported by the version of macOS denoted in
|
||||||
|
# doc/release-notes-empty-template.md and providing at least the
|
||||||
|
# minimum clang version denoted in doc/dependencies.md.
|
||||||
|
# See: https://developer.apple.com/documentation/xcode-release-notes/xcode-15-release-notes
|
||||||
|
sudo xcode-select --switch /Applications/Xcode_15.0.app
|
||||||
|
clang --version
|
||||||
|
|
||||||
@contextlib.contextmanager
|
- name: Install Homebrew packages
|
||||||
def pushd(new_dir) -> None:
|
env:
|
||||||
previous_dir = os.getcwd()
|
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
|
||||||
os.chdir(new_dir)
|
run: |
|
||||||
try:
|
# A workaround for "The `brew link` step did not complete successfully" error.
|
||||||
yield
|
brew install --quiet python@3 || brew link --overwrite python@3
|
||||||
finally:
|
brew install --quiet coreutils ninja pkgconf gnu-getopt ccache boost libevent zeromq qt@6 qrencode
|
||||||
os.chdir(previous_dir)
|
|
||||||
|
|
||||||
|
- name: Set Ccache directory
|
||||||
|
run: echo "CCACHE_DIR=${RUNNER_TEMP}/ccache_dir" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
def download_binary(tag, args) -> int:
|
- name: Restore Ccache cache
|
||||||
if Path(tag).is_dir():
|
id: ccache-cache
|
||||||
if not args.remove_dir:
|
uses: actions/cache/restore@v4
|
||||||
print('Using cached {}'.format(tag))
|
with:
|
||||||
return 0
|
path: ${{ env.CCACHE_DIR }}
|
||||||
shutil.rmtree(tag)
|
key: ${{ github.job }}-${{ matrix.job-type }}-ccache-${{ github.run_id }}
|
||||||
Path(tag).mkdir()
|
restore-keys: ${{ github.job }}-${{ matrix.job-type }}-ccache-
|
||||||
bin_path = 'bin/bitcoin-core-{}'.format(tag[1:])
|
|
||||||
match = re.compile('v(.*)(rc[0-9]+)$').search(tag)
|
|
||||||
if match:
|
|
||||||
bin_path = 'bin/bitcoin-core-{}/test.{}'.format(
|
|
||||||
match.group(1), match.group(2))
|
|
||||||
platform = args.platform
|
|
||||||
if tag < "v23" and platform in ["x86_64-apple-darwin", "arm64-apple-darwin"]:
|
|
||||||
platform = "osx64"
|
|
||||||
tarball = 'bitcoin-{tag}-{platform}.tar.gz'.format(
|
|
||||||
tag=tag[1:], platform=platform)
|
|
||||||
if platform == "win64" and tag >= "v22.0":
|
|
||||||
tarball = 'bitcoin-{tag}-{platform}.zip'.format(
|
|
||||||
tag=tag[1:], platform=platform)
|
|
||||||
tarballUrl = 'https://bitcoincore.org/{bin_path}/{tarball}'.format(
|
|
||||||
bin_path=bin_path, tarball=tarball)
|
|
||||||
|
|
||||||
print('Fetching: {tarballUrl}'.format(tarballUrl=tarballUrl))
|
- name: CI script
|
||||||
|
run: ./ci/test_run_all.sh
|
||||||
|
env:
|
||||||
|
FILE_ENV: ${{ matrix.file-env }}
|
||||||
|
|
||||||
ret = subprocess.run(['curl', '--fail', '--remote-name', tarballUrl]).returncode
|
- name: Save Ccache cache
|
||||||
if ret:
|
uses: actions/cache/save@v4
|
||||||
return ret
|
if: github.event_name != 'pull_request' && steps.ccache-cache.outputs.cache-hit != 'true'
|
||||||
|
with:
|
||||||
|
path: ${{ env.CCACHE_DIR }}
|
||||||
|
# https://github.com/actions/cache/blob/main/tips-and-workarounds.md#update-a-cache
|
||||||
|
key: ${{ github.job }}-${{ matrix.job-type }}-ccache-${{ github.run_id }}
|
||||||
|
|
||||||
hasher = hashlib.sha256()
|
windows-native-dll:
|
||||||
with open(tarball, "rb") as afile:
|
name: ${{ matrix.job-name }}
|
||||||
hasher.update(afile.read())
|
runs-on: windows-2022
|
||||||
tarballHash = hasher.hexdigest()
|
|
||||||
|
|
||||||
if tarballHash not in SHA256_SUMS or SHA256_SUMS[tarballHash]['tarball'] != tarball:
|
if: ${{ vars.SKIP_BRANCH_PUSH != 'true' || github.event_name == 'pull_request' }}
|
||||||
if tarball in [v['tarball'] for v in SHA256_SUMS.values()]:
|
|
||||||
print("Checksum did not match")
|
|
||||||
return 1
|
|
||||||
|
|
||||||
print("Checksum for given version doesn't exist")
|
env:
|
||||||
return 1
|
PYTHONUTF8: 1
|
||||||
print("Checksum matched")
|
TEST_RUNNER_TIMEOUT_FACTOR: 40
|
||||||
|
DOWNLOAD_PREVIOUS_RELEASES: "true"
|
||||||
|
|
||||||
# Extract tarball
|
strategy:
|
||||||
if platform == "win64" and tag >= "v22.0":
|
fail-fast: false
|
||||||
# Handle zip files for Windows
|
matrix:
|
||||||
import zipfile
|
job-type: [standard, fuzz]
|
||||||
with zipfile.ZipFile(tarball, 'r') as zip_ref:
|
include:
|
||||||
zip_ref.extractall(tag)
|
- job-type: standard
|
||||||
# Rename the directory to match expected structure
|
generate-options: '-DBUILD_GUI=ON -DWITH_BDB=ON -DWITH_ZMQ=ON -DBUILD_BENCH=ON -DWERROR=ON'
|
||||||
extracted_dir = Path(tag) / f"bitcoin-{tag[1:]}"
|
job-name: 'Windows native, VS 2022'
|
||||||
if extracted_dir.exists():
|
- job-type: fuzz
|
||||||
for item in extracted_dir.iterdir():
|
generate-options: '-DVCPKG_MANIFEST_NO_DEFAULT_FEATURES=ON -DVCPKG_MANIFEST_FEATURES="wallet" -DBUILD_GUI=OFF -DBUILD_FOR_FUZZING=ON -DWERROR=ON'
|
||||||
shutil.move(str(item), str(Path(tag) / item.name))
|
job-name: 'Windows native, fuzz, VS 2022'
|
||||||
extracted_dir.rmdir()
|
|
||||||
else:
|
|
||||||
# Standard tar extraction
|
|
||||||
ret = subprocess.run(['tar', '-zxf', tarball, '-C', tag,
|
|
||||||
'--strip-components=1',
|
|
||||||
'bitcoin-{tag}'.format(tag=tag[1:])]).returncode
|
|
||||||
if ret != 0:
|
|
||||||
print(f"Failed to extract the {tag} tarball")
|
|
||||||
return ret
|
|
||||||
|
|
||||||
Path(tarball).unlink()
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
if tag >= "v23" and platform == "arm64-apple-darwin":
|
- name: Configure Developer Command Prompt for Microsoft Visual C++
|
||||||
# Starting with v23 there are arm64 binaries for ARM (e.g. M1, M2) macs, but they have to be signed to run
|
# Using microsoft/setup-msbuild is not enough.
|
||||||
binary_path = f'{os.getcwd()}/{tag}/bin/'
|
uses: ilammy/msvc-dev-cmd@v1
|
||||||
|
with:
|
||||||
|
arch: x64
|
||||||
|
|
||||||
for arm_binary in os.listdir(binary_path):
|
- name: Get tool information
|
||||||
# Is it already signed?
|
shell: pwsh
|
||||||
ret = subprocess.run(
|
run: |
|
||||||
['codesign', '-v', binary_path + arm_binary],
|
cmake -version | Tee-Object -FilePath "cmake_version"
|
||||||
stderr=subprocess.DEVNULL, # Suppress expected stderr output
|
Write-Output "---"
|
||||||
).returncode
|
msbuild -version | Tee-Object -FilePath "msbuild_version"
|
||||||
if ret == 1:
|
$env:VCToolsVersion | Tee-Object -FilePath "toolset_version"
|
||||||
# Have to self-sign the binary
|
py -3 --version
|
||||||
ret = subprocess.run(
|
Write-Host "PowerShell version $($PSVersionTable.PSVersion.ToString())"
|
||||||
['codesign', '-s', '-', binary_path + arm_binary]
|
bash --version
|
||||||
).returncode
|
|
||||||
if ret != 0:
|
|
||||||
print(f"Failed to self-sign {tag} {arm_binary} arm64 binary")
|
|
||||||
return 1
|
|
||||||
|
|
||||||
# Confirm success
|
- name: Using vcpkg with MSBuild
|
||||||
ret = subprocess.run(
|
run: |
|
||||||
['codesign', '-v', binary_path + arm_binary]
|
echo "set(VCPKG_BUILD_TYPE release)" >> "${VCPKG_INSTALLATION_ROOT}/triplets/x64-windows.cmake"
|
||||||
).returncode
|
# Workaround for libevent, which requires CMake 3.1 but is incompatible with CMake >= 4.0.
|
||||||
if ret != 0:
|
sed -i '1s/^/set(ENV{CMAKE_POLICY_VERSION_MINIMUM} 3.5)\n/' "${VCPKG_INSTALLATION_ROOT}/scripts/ports.cmake"
|
||||||
print(f"Failed to verify the self-signed {tag} {arm_binary} arm64 binary")
|
|
||||||
return 1
|
|
||||||
|
|
||||||
return 0
|
- name: vcpkg tools cache
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: C:/vcpkg/downloads/tools
|
||||||
|
key: ${{ github.job }}-vcpkg-tools
|
||||||
|
|
||||||
|
- name: Restore vcpkg binary cache
|
||||||
|
uses: actions/cache/restore@v4
|
||||||
|
id: vcpkg-binary-cache
|
||||||
|
with:
|
||||||
|
path: ~/AppData/Local/vcpkg/archives
|
||||||
|
key: ${{ github.job }}-vcpkg-binary-${{ hashFiles('cmake_version', 'msbuild_version', 'toolset_version', 'vcpkg.json') }}
|
||||||
|
|
||||||
def build_release(tag, args) -> int:
|
- name: Generate build system
|
||||||
githubUrl = "https://github.com/bitcoin/bitcoin"
|
run: |
|
||||||
if args.remove_dir:
|
cmake -B build --preset vs2022 -DCMAKE_TOOLCHAIN_FILE="${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake" ${{ matrix.generate-options }}
|
||||||
if Path(tag).is_dir():
|
|
||||||
shutil.rmtree(tag)
|
|
||||||
if not Path(tag).is_dir():
|
|
||||||
# fetch new tags
|
|
||||||
subprocess.run(
|
|
||||||
["git", "fetch", githubUrl, "--tags"])
|
|
||||||
output = subprocess.check_output(['git', 'tag', '-l', tag])
|
|
||||||
if not output:
|
|
||||||
print('Tag {} not found'.format(tag))
|
|
||||||
return 1
|
|
||||||
ret = subprocess.run([
|
|
||||||
'git', 'clone', f'--branch={tag}', '--depth=1', githubUrl, tag
|
|
||||||
]).returncode
|
|
||||||
if ret:
|
|
||||||
return ret
|
|
||||||
with pushd(tag):
|
|
||||||
host = args.host
|
|
||||||
if args.depends:
|
|
||||||
with pushd('depends'):
|
|
||||||
ret = subprocess.run(['make', 'NO_QT=1']).returncode
|
|
||||||
if ret:
|
|
||||||
return ret
|
|
||||||
host = os.environ.get(
|
|
||||||
'HOST', subprocess.check_output(['./config.guess']))
|
|
||||||
config_flags = '--prefix={pwd}/depends/{host} '.format(
|
|
||||||
pwd=os.getcwd(),
|
|
||||||
host=host) + args.config_flags
|
|
||||||
cmds = [
|
|
||||||
'./autogen.sh',
|
|
||||||
'./configure {}'.format(config_flags),
|
|
||||||
'make',
|
|
||||||
]
|
|
||||||
for cmd in cmds:
|
|
||||||
ret = subprocess.run(cmd.split()).returncode
|
|
||||||
if ret:
|
|
||||||
return ret
|
|
||||||
# Move binaries, so they're in the same place as in the
|
|
||||||
# release download
|
|
||||||
Path('bin').mkdir(exist_ok=True)
|
|
||||||
files = ['bitcoind', 'bitcoin-cli', 'bitcoin-tx']
|
|
||||||
for f in files:
|
|
||||||
Path('src/'+f).rename('bin/'+f)
|
|
||||||
return 0
|
|
||||||
|
|
||||||
|
- name: Save vcpkg binary cache
|
||||||
|
uses: actions/cache/save@v4
|
||||||
|
if: github.event_name != 'pull_request' && steps.vcpkg-binary-cache.outputs.cache-hit != 'true' && matrix.job-type == 'standard'
|
||||||
|
with:
|
||||||
|
path: ~/AppData/Local/vcpkg/archives
|
||||||
|
key: ${{ github.job }}-vcpkg-binary-${{ hashFiles('cmake_version', 'msbuild_version', 'toolset_version', 'vcpkg.json') }}
|
||||||
|
|
||||||
def check_host(args) -> int:
|
- name: Build
|
||||||
# On Windows, config.guess script doesn't work, so we set host manually
|
working-directory: build
|
||||||
if sys.platform == 'win32':
|
run: |
|
||||||
args.host = 'x86_64-w64-mingw32'
|
cmake --build . -j $NUMBER_OF_PROCESSORS --config Release
|
||||||
else:
|
|
||||||
args.host = os.environ.get('HOST', subprocess.check_output(
|
|
||||||
'./depends/config.guess').decode())
|
|
||||||
if args.download_binary:
|
|
||||||
platforms = {
|
|
||||||
'aarch64-*-linux*': 'aarch64-linux-gnu',
|
|
||||||
'powerpc64le-*-linux-*': 'powerpc64le-linux-gnu',
|
|
||||||
'riscv64-*-linux*': 'riscv64-linux-gnu',
|
|
||||||
'x86_64-*-linux*': 'x86_64-linux-gnu',
|
|
||||||
'x86_64-apple-darwin*': 'x86_64-apple-darwin',
|
|
||||||
'aarch64-apple-darwin*': 'arm64-apple-darwin',
|
|
||||||
'x86_64-w64-mingw32': 'win64',
|
|
||||||
'x86_64-*-win*': 'win64',
|
|
||||||
}
|
|
||||||
args.platform = ''
|
|
||||||
for pattern, target in platforms.items():
|
|
||||||
if fnmatch(args.host, pattern):
|
|
||||||
args.platform = target
|
|
||||||
if not args.platform:
|
|
||||||
print('Not sure which binary to download for {}'.format(args.host))
|
|
||||||
return 1
|
|
||||||
return 0
|
|
||||||
|
|
||||||
|
- name: Run test suite
|
||||||
|
if: matrix.job-type == 'standard'
|
||||||
|
working-directory: build
|
||||||
|
env:
|
||||||
|
QT_PLUGIN_PATH: '${{ github.workspace }}\build\vcpkg_installed\x64-windows\Qt6\plugins'
|
||||||
|
run: |
|
||||||
|
ctest --output-on-failure --stop-on-failure -j $NUMBER_OF_PROCESSORS -C Release
|
||||||
|
|
||||||
def main(args) -> int:
|
- name: Run functional tests
|
||||||
Path(args.target_dir).mkdir(exist_ok=True, parents=True)
|
if: matrix.job-type == 'standard'
|
||||||
print("Releases directory: {}".format(args.target_dir))
|
working-directory: build
|
||||||
ret = check_host(args)
|
env:
|
||||||
if ret:
|
BITCOIND: '${{ github.workspace }}\build\bin\Release\bitcoind.exe'
|
||||||
return ret
|
BITCOINCLI: '${{ github.workspace }}\build\bin\Release\bitcoin-cli.exe'
|
||||||
if args.download_binary:
|
BITCOINUTIL: '${{ github.workspace }}\build\bin\Release\bitcoin-util.exe'
|
||||||
with pushd(args.target_dir):
|
BITCOINWALLET: '${{ github.workspace }}\build\bin\Release\bitcoin-wallet.exe'
|
||||||
for tag in args.tags:
|
TEST_RUNNER_EXTRA: ${{ github.event_name != 'pull_request' && '--extended' || '' }}
|
||||||
ret = download_binary(tag, args)
|
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}
|
||||||
if ret:
|
|
||||||
return ret
|
|
||||||
return 0
|
|
||||||
args.config_flags = os.environ.get('CONFIG_FLAGS', '')
|
|
||||||
args.config_flags += ' --without-gui --disable-tests --disable-bench'
|
|
||||||
with pushd(args.target_dir):
|
|
||||||
for tag in args.tags:
|
|
||||||
ret = build_release(tag, args)
|
|
||||||
if ret:
|
|
||||||
return ret
|
|
||||||
return 0
|
|
||||||
|
|
||||||
|
- name: Clone corpora
|
||||||
|
if: matrix.job-type == 'fuzz'
|
||||||
|
run: |
|
||||||
|
git clone --depth=1 https://github.com/bitcoin-core/qa-assets "${RUNNER_TEMP}/qa-assets"
|
||||||
|
cd "${RUNNER_TEMP}/qa-assets"
|
||||||
|
echo "Using qa-assets repo from commit ..."
|
||||||
|
git log -1
|
||||||
|
|
||||||
if __name__ == '__main__':
|
- name: Run fuzz tests
|
||||||
parser = argparse.ArgumentParser(
|
if: matrix.job-type == 'fuzz'
|
||||||
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
|
working-directory: build
|
||||||
parser.add_argument('-r', '--remove-dir', action='store_true',
|
env:
|
||||||
help='remove existing directory.')
|
BITCOINFUZZ: '${{ github.workspace }}\build\bin\Release\fuzz.exe'
|
||||||
parser.add_argument('-d', '--depends', action='store_true',
|
run: |
|
||||||
help='use depends.')
|
py -3 test/fuzz/test_runner.py --par $NUMBER_OF_PROCESSORS --loglevel DEBUG "${RUNNER_TEMP}/qa-assets/fuzz_corpora"
|
||||||
parser.add_argument('-b', '--download-binary', action='store_true',
|
|
||||||
help='download release binary.')
|
windows-cross:
|
||||||
parser.add_argument('-t', '--target-dir', action='store',
|
name: 'Linux->Windows cross, no tests'
|
||||||
help='target directory.', default='releases')
|
runs-on: ubuntu-latest
|
||||||
all_tags = sorted([*set([v['tag'] for v in SHA256_SUMS.values()])])
|
if: ${{ vars.SKIP_BRANCH_PUSH != 'true' || github.event_name == 'pull_request' }}
|
||||||
parser.add_argument('tags', nargs='*', default=all_tags,
|
|
||||||
help='release tags. e.g.: v0.18.1 v0.20.0rc2 '
|
env:
|
||||||
'(if not specified, the full list needed for '
|
FILE_ENV: './ci/test/00_setup_env_win64.sh'
|
||||||
'backwards compatibility tests will be used)'
|
DANGER_CI_ON_HOST_FOLDERS: 1
|
||||||
)
|
|
||||||
args = parser.parse_args()
|
steps:
|
||||||
sys.exit(main(args))
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set CI directories
|
||||||
|
run: |
|
||||||
|
echo "CCACHE_DIR=${{ runner.temp }}/ccache_dir" >> "$GITHUB_ENV"
|
||||||
|
echo "BASE_ROOT_DIR=${{ runner.temp }}" >> "$GITHUB_ENV"
|
||||||
|
echo "DEPENDS_DIR=${{ runner.temp }}/depends" >> "$GITHUB_ENV"
|
||||||
|
echo "BASE_BUILD_DIR=${{ runner.temp }}/build" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
|
- name: Depends cache
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: ${{ env.DEPENDS_DIR }}/built
|
||||||
|
key: ${{ github.job }}-depends-${{ hashFiles('depends/**', 'ci/test/00_setup_env_win64.sh') }}
|
||||||
|
|
||||||
|
- name: Restore Ccache cache
|
||||||
|
id: ccache-cache
|
||||||
|
uses: actions/cache/restore@v4
|
||||||
|
with:
|
||||||
|
path: ${{ env.CCACHE_DIR }}
|
||||||
|
key: ${{ github.job }}-ccache-${{ github.run_id }}
|
||||||
|
restore-keys: ${{ github.job }}-ccache-
|
||||||
|
|
||||||
|
- name: CI script
|
||||||
|
run: ./ci/test_run_all.sh
|
||||||
|
|
||||||
|
- name: Save Ccache cache
|
||||||
|
uses: actions/cache/save@v4
|
||||||
|
if: github.event_name != 'pull_request' && steps.ccache-cache.outputs.cache-hit != 'true'
|
||||||
|
with:
|
||||||
|
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 }}/bin/*.exe
|
||||||
|
${{ env.BASE_BUILD_DIR }}/src/secp256k1/bin/*.exe
|
||||||
|
${{ env.BASE_BUILD_DIR }}/src/univalue/*.exe
|
||||||
|
${{ env.BASE_BUILD_DIR }}/test/config.ini
|
||||||
|
|
||||||
|
windows-native-test:
|
||||||
|
name: 'Windows, test cross-built'
|
||||||
|
runs-on: windows-2022
|
||||||
|
needs: windows-cross
|
||||||
|
|
||||||
|
env:
|
||||||
|
PYTHONUTF8: 1
|
||||||
|
TEST_RUNNER_TIMEOUT_FACTOR: 40
|
||||||
|
DOWNLOAD_PREVIOUS_RELEASES: "true"
|
||||||
|
PREVIOUS_RELEASES_DIR: ${{ github.workspace }}/releases
|
||||||
|
|
||||||
|
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: ./bin/bitcoind.exe -version
|
||||||
|
|
||||||
|
- name: Run unit tests
|
||||||
|
# Can't use ctest here like other jobs as we don't have a CMake build tree.
|
||||||
|
run: |
|
||||||
|
./bin/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: ./bin/bench_bitcoin.exe -sanity-check
|
||||||
|
|
||||||
|
- name: Adjust paths in test/config.ini
|
||||||
|
shell: pwsh
|
||||||
|
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: Download previous releases
|
||||||
|
if: env.DOWNLOAD_PREVIOUS_RELEASES == 'true'
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
mkdir -p ${{ env.PREVIOUS_RELEASES_DIR }}
|
||||||
|
python test/get_previous_releases.py -b -t "${{ env.PREVIOUS_RELEASES_DIR }}"
|
||||||
|
|
||||||
|
- name: Run wallet_migration.py test
|
||||||
|
if: env.DOWNLOAD_PREVIOUS_RELEASES == 'true'
|
||||||
|
env:
|
||||||
|
PYTHONIOENCODING: utf-8
|
||||||
|
run: py -3 test/functional/wallet_migration.py --previous-releases
|
||||||
|
|
||||||
|
- name: Run functional tests
|
||||||
|
env:
|
||||||
|
# TODO: Fix the excluded test and re-enable it.
|
||||||
|
EXCLUDE: '--exclude wallet_multiwallet.py'
|
||||||
|
PYTHONIOENCODING: utf-8
|
||||||
|
TEST_RUNNER_EXTRA: ${{ github.event_name != 'pull_request' && '--extended' || '' }}
|
||||||
|
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
|
||||||
|
if: ${{ vars.SKIP_BRANCH_PUSH != 'true' || github.event_name == 'pull_request' }}
|
||||||
|
timeout-minutes: 120
|
||||||
|
env:
|
||||||
|
FILE_ENV: "./ci/test/00_setup_env_native_asan.sh"
|
||||||
|
DANGER_CI_ON_HOST_FOLDERS: 1
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set CI directories
|
||||||
|
run: |
|
||||||
|
echo "CCACHE_DIR=${{ runner.temp }}/ccache_dir" >> "$GITHUB_ENV"
|
||||||
|
echo "BASE_ROOT_DIR=${{ runner.temp }}" >> "$GITHUB_ENV"
|
||||||
|
echo "BASE_BUILD_DIR=${{ runner.temp }}/build-asan" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
|
- name: Restore Ccache cache
|
||||||
|
id: ccache-cache
|
||||||
|
uses: actions/cache/restore@v4
|
||||||
|
with:
|
||||||
|
path: ${{ env.CCACHE_DIR }}
|
||||||
|
key: ${{ github.job }}-ccache-${{ github.run_id }}
|
||||||
|
restore-keys: ${{ github.job }}-ccache-
|
||||||
|
|
||||||
|
- name: Enable bpfcc script
|
||||||
|
# In the image build step, no external environment variables are available,
|
||||||
|
# so any settings will need to be written to the settings env file:
|
||||||
|
run: sed -i "s|\${INSTALL_BCC_TRACING_TOOLS}|true|g" ./ci/test/00_setup_env_native_asan.sh
|
||||||
|
|
||||||
|
- name: CI script
|
||||||
|
run: ./ci/test_run_all.sh
|
||||||
|
|
||||||
|
- name: Save Ccache cache
|
||||||
|
uses: actions/cache/save@v4
|
||||||
|
if: github.event_name != 'pull_request' && steps.ccache-cache.outputs.cache-hit != 'true'
|
||||||
|
with:
|
||||||
|
path: ${{ env.CCACHE_DIR }}
|
||||||
|
# https://github.com/actions/cache/blob/main/tips-and-workarounds.md#update-a-cache
|
||||||
|
key: ${{ github.job }}-ccache-${{ github.run_id }}
|
||||||
|
|
Loading…
Add table
Reference in a new issue