Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
b5d03f8
feat(ci): standardize BSD tests with matrix strategy
bitcoin-tools Sep 28, 2025
e01a439
Update validation.yaml
bitcoin-tools Sep 28, 2025
15002ed
Update validation.yaml
bitcoin-tools Sep 28, 2025
8425c01
Update validation.yaml
bitcoin-tools Sep 28, 2025
aaf0e67
Update validation.yaml
bitcoin-tools Sep 28, 2025
2ae4145
Merge branch 'master' into 2451-feat---refactor-the-bsd-yaml-into-a-m…
bitcoin-tools Oct 6, 2025
da3debe
use separate steps for each os
bitcoin-tools Oct 6, 2025
80ae00e
fix syntax and add arch strategy
bitcoin-tools Oct 6, 2025
174befc
Update validation.yaml
bitcoin-tools Oct 6, 2025
9bdcdb4
Update validation.yaml
bitcoin-tools Oct 6, 2025
efceab4
Update validation.yaml
bitcoin-tools Oct 6, 2025
272a60e
Update nodebuilder
bitcoin-tools Oct 6, 2025
0ba3822
Update nodebuilder
bitcoin-tools Oct 6, 2025
4d26648
Update nodebuilder
bitcoin-tools Oct 6, 2025
787bda3
if running in CI and NetBSD, reduce maxconnections
bitcoin-tools Oct 7, 2025
604b2c8
Update nodebuilder
bitcoin-tools Oct 7, 2025
c639779
Update nodebuilder
bitcoin-tools Oct 7, 2025
3de0c89
set arch
bitcoin-tools Oct 7, 2025
78ba370
add back vm-arch
bitcoin-tools Oct 7, 2025
67c9f7e
Update nodebuilder
bitcoin-tools Oct 7, 2025
6fe79f0
Update validation.yaml
bitcoin-tools Oct 7, 2025
f1a354e
Update validation.yaml
bitcoin-tools Oct 7, 2025
4302ca4
Update validation.yaml
bitcoin-tools Oct 7, 2025
87de93d
move the maxconnections setting to conf file
bitcoin-tools Oct 7, 2025
6da982d
Merge branch 'master' into 2451-feat---refactor-the-bsd-yaml-into-a-m…
bitcoin-tools Oct 7, 2025
544603a
fix issue with openbsd directory check
bitcoin-tools Oct 7, 2025
146c3aa
Update nodebuilder
bitcoin-tools Oct 7, 2025
42cea6f
Update test_nodebuilder
bitcoin-tools Oct 7, 2025
82b0466
Update validation.yaml
bitcoin-tools Oct 7, 2025
2125ba6
Update validation.yaml
bitcoin-tools Oct 7, 2025
dbbc8a6
Update validation.yaml
bitcoin-tools Oct 7, 2025
40865c3
Update validation.yaml
bitcoin-tools Oct 7, 2025
2d2c555
use env for debug.log path
bitcoin-tools Oct 7, 2025
865fdc4
move ends to job level not step level
bitcoin-tools Oct 10, 2025
887ec09
Update validation.yaml
bitcoin-tools Oct 10, 2025
893c778
Update validation.yaml
bitcoin-tools Oct 10, 2025
356a628
update freebsd log path
bitcoin-tools Oct 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
156 changes: 68 additions & 88 deletions .github/workflows/validation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,8 @@ jobs:
if: steps.test-nodebuilder.outcome == 'failure'
run: printf '%s\n' "Review the step 'Test the console output' above." && exit 1

run-nodebuilder-freebsd:
name: Test source on FreeBSD
run-nodebuilder-bsd-vm:
name: Test source on ${{ matrix.vm-os-friendly-name }} [${{ matrix.vm-arch }}]
needs: [changes, shell-lint, yaml-lint]
if: >-
${{
Expand All @@ -288,126 +288,106 @@ jobs:
needs.changes.outputs.test == 'true'
}}
runs-on: ubuntu-latest
env:
FREEBSD_BITCOIN_LOG_PATH: /root/.bitcoin/debug.log
NETBSD_BITCOIN_LOG_PATH: /home/runner/.bitcoin/debug.log
OPENBSD_BITCOIN_LOG_PATH: /home/bitcoin/.bitcoin/debug.log
strategy:
fail-fast: false
max-parallel: 3
matrix:
vm-arch: [x86_64]
vm-os: [freebsd, netbsd, openbsd]
include:
- { vm-os: freebsd, vm-os-friendly-name: FreeBSD }
- { vm-os: netbsd, vm-os-friendly-name: NetBSD }
- { vm-os: openbsd, vm-os-friendly-name: OpenBSD }
steps:
- uses: actions/checkout@v5
- name: Test the console output
- name: Test the FreeBSD console output
if: ${{ matrix.vm-os == 'freebsd' }}
uses: vmactions/freebsd-vm@v1
timeout-minutes: 180
with:
prepare: |
echo "${TERM:-TERM is not found}"
uname -a
cat /etc/os-release
nproc
sysctl -a | grep ' memory' | head -2
df -h
commmand -v tput
tput colors
date -u
arch: ${{ matrix.vm-arch }}
envs: 'CI FREEBSD_BITCOIN_LOG_PATH'
usesh: true
run: |
sh -x ./test/test_nodebuilder --ref "${GITHUB_SHA}"
if [ "$?" -eq 0 ]; then
[ -f "${HOME}/.bitcoin/debug.log" ] && cp "${HOME}/.bitcoin/debug.log" .
echo "DEBUG HOME is ${HOME}"
echo "DEBUG working directory is $(pwd)"
echo "DEBUG listing /root/.bitcoin/debug.log"
ls -l /root/.bitcoin/debug.log || true
echo "DEBUG listing /home/runner/.bitcoin/debug.log"
ls -l /home/runner/.bitcoin/debug.log || true
echo "DEBUG listing /home/bitcoin/.bitcoin/debug.log"
ls -l /home/runner/.bitcoin/debug.log || true
[ -f "${FREEBSD_BITCOIN_LOG_PATH}" ] && cp "${FREEBSD_BITCOIN_LOG_PATH}" .
else
echo "test_nodebuilder exited with non-zero status" >&2
echo "Running nodebuilder with xtrace enabled" >&2
echo "${{ matrix.vm-os }} test failed with non-zero exit status." >&2
echo "Running nodebuilder with xtrace enabled"
sh -x ./nodebuilder
[ -f "${HOME}/.bitcoin/debug.log" ] && cp "${HOME}/.bitcoin/debug.log" .
[ -f "${FREEBSD_BITCOIN_LOG_PATH}" ] && cp "${FREEBSD_BITCOIN_LOG_PATH}" .
exit 1
fi
- name: Save Bitcoin Core log as artifact
uses: actions/upload-artifact@v4
with:
name: freebsd-source-bitcoin-debug.log
path: /home/runner/work/nodebuilder/nodebuilder/debug.log

run-nodebuilder-netbsd:
name: Test source on NetBSD
needs: [changes, shell-lint, yaml-lint]
if: >-
${{
github.event.action == 'prerelease' ||
github.event.action == 'published' ||
needs.changes.outputs.ci == 'true' ||
needs.changes.outputs.dependencies == 'true' ||
needs.changes.outputs.shell == 'true' ||
needs.changes.outputs.test == 'true'
}}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Test the console output
- name: Test the NetBSD console output
if: ${{ matrix.vm-os == 'netbsd' }}
uses: vmactions/netbsd-vm@v1
timeout-minutes: 180
with:
prepare: |
echo "${TERM:-TERM is not found}"
uname -a
sysctl -n hw.ncpu
sysctl -n hw.physmem64
swapctl -l
df -h
date -u
arch: ${{ matrix.vm-arch }}
envs: 'CI NETBSD_BITCOIN_LOG_PATH'
run: |
sh -c ./nodebuilder
sh -x ./test/test_nodebuilder --ref "${GITHUB_SHA}"
if [ "$?" -eq 0 ]; then
[ -f "/root/.bitcoin/debug.log" ] && cp "/root/.bitcoin/debug.log" .
echo "DEBUG HOME is ${HOME}"
echo "DEBUG working directory is $(pwd)"
echo "DEBUG listing /root/.bitcoin/debug.log"
ls -l /root/.bitcoin/debug.log || true
echo "DEBUG listing /home/runner/.bitcoin/debug.log"
ls -l /home/runner/.bitcoin/debug.log || true
echo "DEBUG listing /home/bitcoin/.bitcoin/debug.log"
ls -l /home/runner/.bitcoin/debug.log || true
[ -f "${NETBSD_BITCOIN_LOG_PATH}" ] && cp "${NETBSD_BITCOIN_LOG_PATH}" .
else
echo "nodebuilder exited with non-zero status" >&2
echo "Re-running nodebuilder with xtrace enabled" >&2
echo "${{ matrix.vm-os }} test failed with non-zero exit status." >&2
echo "Running nodebuilder with xtrace enabled"
sh -x ./nodebuilder
[ -f "/root/.bitcoin/debug.log" ] && cp "/root/.bitcoin/debug.log" .
[ -f "${NETBSD_BITCOIN_LOG_PATH}" ] && cp "${NETBSD_BITCOIN_LOG_PATH}" .
exit 1
fi
- name: Save Bitcoin Core log as artifact
uses: actions/upload-artifact@v4
with:
name: netbsd-source-bitcoin-debug.log
path: /home/runner/work/nodebuilder/nodebuilder/debug.log

run-nodebuilder-openbsd:
name: Test source on OpenBSD
needs: [changes, shell-lint, yaml-lint]
if: >-
${{
github.event.action == 'prerelease' ||
github.event.action == 'published' ||
needs.changes.outputs.ci == 'true' ||
needs.changes.outputs.dependencies == 'true' ||
needs.changes.outputs.shell == 'true' ||
needs.changes.outputs.test == 'true'
}}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Test the console output
- name: Test the OpenBSD console output
if: ${{ matrix.vm-os == 'openbsd' }}
uses: vmactions/openbsd-vm@v1
timeout-minutes: 180
with:
prepare: |
echo "${TERM:-TERM is not found}"
uname -a
sysctl hw.ncpu
sysctl -a | grep 'hw.physmem\|hw.usermem'
df -h
commmand -v tput
tput colors
date -u
arch: ${{ matrix.vm-arch }}
envs: 'CI OPENBSD_BITCOIN_LOG_PATH'
usesh: true
run: |
sh -x ./test/test_nodebuilder --ref "${GITHUB_SHA}"
if [ "$?" -eq 0 ]; then
[ -f "/home/bitcoin/.bitcoin/debug.log" ] && cp "/home/bitcoin/.bitcoin/debug.log" .
echo "DEBUG HOME is ${HOME}"
echo "DEBUG working directory is $(pwd)"
echo "DEBUG listing /root/.bitcoin/debug.log"
ls -l /root/.bitcoin/debug.log || true
echo "DEBUG listing /home/runner/.bitcoin/debug.log"
ls -l /home/runner/.bitcoin/debug.log || true
echo "DEBUG listing /home/bitcoin/.bitcoin/debug.log"
ls -l /home/runner/.bitcoin/debug.log || true
[ -f "${OPENBSD_BITCOIN_LOG_PATH}" ] && cp "${OPENBSD_BITCOIN_LOG_PATH}" .
else
echo "test_nodebuilder exited with non-zero status" >&2
echo "Running nodebuilder with xtrace enabled" >&2
echo "${{ matrix.vm-os }} test failed with non-zero exit status." >&2
echo "Running nodebuilder with xtrace enabled"
sh -x ./nodebuilder
[ -f "/home/bitcoin/.bitcoin/debug.log" ] && cp "/home/bitcoin/.bitcoin/debug.log" .
[ -f "${OPENBSD_BITCOIN_LOG_PATH}" ] && cp "${OPENBSD_BITCOIN_LOG_PATH}" .
exit 1
fi
- name: Save Bitcoin Core log as artifact
uses: actions/upload-artifact@v4
with:
name: openbsd-source-bitcoin-debug.log
name: ${{ matrix.vm-os }}-${{ matrix.vm-arch }}-source-bitcoin-debug.log
path: /home/runner/work/nodebuilder/nodebuilder/debug.log

run-nodebuilder-docker:
Expand Down
20 changes: 11 additions & 9 deletions nodebuilder
Original file line number Diff line number Diff line change
Expand Up @@ -1800,14 +1800,12 @@ else
current_bitcoin_version="${target_bitcoin_version}"
fi

if
command -v bitcoin-qt > /dev/null 2>&1 &&
! is_running_in_ci
if command -v bitcoin-qt > /dev/null 2>&1 &&
! is_running_in_ci &&
! is_running_in_container &&
{
[ -n "${DISPLAY:-}" ] || [ "${TARGET_KERNEL}" = 'Darwin' ]
}
then
{
[ -n "${DISPLAY:-}" ] || [ "${TARGET_KERNEL}" = 'Darwin' ]
}; then
LAUNCH_BITCOIN_CORE_COMMAND="bitcoin-qt --datadir=${BITCOIN_DATA_DIRECTORY}"
elif command -v bitcoind > /dev/null 2>&1; then
LAUNCH_BITCOIN_CORE_COMMAND="bitcoind --daemonwait --datadir=${BITCOIN_DATA_DIRECTORY}"
Expand All @@ -1819,11 +1817,15 @@ readonly LAUNCH_BITCOIN_CORE_COMMAND
[ "${TARGET_KERNEL}" != 'Darwin' ] && create_application_shortcuts

# If bitcoin.conf doesn't already exist, use default settings
[ -d "${BITCOIN_DATA_DIRECTORY}"/ ] || mkdir "${BITCOIN_DATA_DIRECTORY}"/
if [ ! -f "${BITCOIN_CORE_CONFIG_FILE}" ]; then
[ -d "${BITCOIN_DATA_DIRECTORY}"/ ] || mkdir "${BITCOIN_DATA_DIRECTORY}"/
log_info 'Setting the default node behavior.'
set_bitcoin_core_option 'datadir' "${BITCOIN_DATA_DIRECTORY}"
is_running_in_ci && set_bitcoin_core_option 'debug' 'net'
is_running_in_ci &&
set_bitcoin_core_option 'debug' 'net'
is_running_in_ci &&
[ "${TARGET_KERNEL}" = 'NetBSD' ] &&
set_bitcoin_core_option 'maxconnections' '96'
set_bitcoin_core_option 'mempoolfullrbf' '1'
set_bitcoin_core_option 'server' '1'
fi
Expand Down
3 changes: 3 additions & 0 deletions test/test_nodebuilder
Original file line number Diff line number Diff line change
Expand Up @@ -363,3 +363,6 @@ if [ "${TARGET_KERNEL}" = 'Linux' ]; then
fi

printf '%s\n' 'PASS: All console output tests passed.'
echo 'DEBUG KILLING TAIL PROCESS AGAIN'
kill_tail_process
echo 'END OF SCRIPT'