Skip to content

Commit e376b7b

Browse files
ryanofskyclaude
andcommitted
support: split CI, docs, and examples onto support branch
Restructures the repository so CI scripts, docs, and examples live on the support branch while C++ source stays on master. CI uses GitHub reusable workflows so both branches trigger full CI runs. GitHub Actions changes: - ci.yml, bitcoin-core-ci.yml: convert from standalone push/PR triggers to reusable workflows (on: workflow_call) accepting source_ref and support_ref inputs. Each job now checks out the C++ source at the default workspace path and the support branch at .support/. Script references updated from ci/scripts/ (and _libmultiprocess/ci/scripts/) to .support/ci/scripts/. - ci-support-trigger.yml: new workflow that fires on push/PR to the support branch, calling the reusable workflows with source_ref fixed to refs/heads/master and support_ref set to the triggering commit. This lets support branch PRs be validated against master's C++ source. - CI_CONFIG: repurposed from a config file path to a config name (e.g. "default", "llvm"). Scripts now resolve the path internally. Script changes (ci/scripts/): - run.sh: cd to support root before invoking nix so shell.nix and CMakeLists.txt are referenced without a path prefix. - ci.sh, config.sh: resolve CI_CONFIG name to configs/$CI_CONFIG.bash relative to the script location rather than treating it as a full path. - ci.sh: change default BUILD_TARGETS from (all tests mpexamples) to (all mptests mpexamples), since the tests target is only defined when master is the top-level cmake project (MP_STANDALONE=true). New files: - CMakeLists.txt: top-level cmake project for the support branch. Adds the master source tree as a subdirectory (via MP_SOURCE_DIR, defaulting to ..) and then adds example/ as a sibling subdirectory. Enables local builds via cmake -S .support -B .support/build-<name>. - README.md: brief description of support branch contents and how to set up the .support worktree. example/CMakeLists.txt: drop redundant include of TargetCapnpSources.cmake (now included by the parent support CMakeLists.txt before add_subdirectory). ci/README.md: update local run instructions to use CI_CONFIG name style and new .support/ worktree paths. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 2f7b894 commit e376b7b

10 files changed

Lines changed: 202 additions & 60 deletions

File tree

.github/workflows/bitcoin-core-ci.yml

Lines changed: 56 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,17 @@
99
name: Bitcoin Core CI
1010

1111
on:
12-
push:
13-
pull_request:
14-
15-
concurrency:
16-
group: ${{ github.workflow }}-${{ github.ref }}
17-
cancel-in-progress: true
12+
workflow_call:
13+
inputs:
14+
source_ref:
15+
description: 'Ref of libmultiprocess source to test. Defaults to the caller ref (github.sha).'
16+
required: false
17+
type: string
18+
support_ref:
19+
description: 'Ref of support branch to use for CI scripts. Defaults to support HEAD.'
20+
required: false
21+
type: string
22+
default: 'support'
1823

1924
env:
2025
BITCOIN_REPO: bitcoin/bitcoin
@@ -85,32 +90,41 @@ jobs:
8590
uses: actions/checkout@v4
8691
with:
8792
path: _libmultiprocess
93+
ref: ${{ inputs.source_ref || github.sha }}
94+
repository: ${{ github.repository }}
95+
96+
- name: Checkout support branch
97+
uses: actions/checkout@v4
98+
with:
99+
ref: ${{ inputs.support_ref }}
100+
path: support
101+
repository: ${{ github.repository }}
88102

89103
- name: Replace libmultiprocess subtree
90-
run: _libmultiprocess/ci/scripts/bitcoin_core_ci.sh replace_subtree
104+
run: support/ci/scripts/bitcoin_core_ci.sh replace_subtree
91105

92106
- name: Add LLVM apt repository
93107
if: matrix.apt-llvm
94-
run: _libmultiprocess/ci/scripts/bitcoin_core_ci.sh add_llvm_apt_repository
108+
run: support/ci/scripts/bitcoin_core_ci.sh add_llvm_apt_repository
95109

96110
- name: Install APT packages
97111
if: matrix.packages
98-
run: _libmultiprocess/ci/scripts/ci_helpers.sh install_apt_packages ${{ matrix.packages }}
112+
run: support/ci/scripts/ci_helpers.sh install_apt_packages ${{ matrix.packages }}
99113

100114
- name: Configure LLVM alternatives
101115
if: matrix.packages
102-
run: _libmultiprocess/ci/scripts/bitcoin_core_ci.sh install_llvm_alternatives
116+
run: support/ci/scripts/bitcoin_core_ci.sh install_llvm_alternatives
103117

104118
- name: Install Homebrew packages
105119
if: matrix.brew-packages
106-
run: _libmultiprocess/ci/scripts/ci_helpers.sh install_homebrew_packages ${{ matrix.brew-packages }}
120+
run: support/ci/scripts/ci_helpers.sh install_homebrew_packages ${{ matrix.brew-packages }}
107121

108122
- name: Install pip packages
109123
if: matrix.pip-packages
110-
run: _libmultiprocess/ci/scripts/ci_helpers.sh install_pip_packages ${{ matrix.pip-packages }}
124+
run: support/ci/scripts/ci_helpers.sh install_pip_packages ${{ matrix.pip-packages }}
111125

112126
- name: Determine parallelism
113-
run: _libmultiprocess/ci/scripts/ci_helpers.sh determine_parallelism "${{ matrix.nproc_multiplier }}"
127+
run: support/ci/scripts/ci_helpers.sh determine_parallelism "${{ matrix.nproc_multiplier }}"
114128

115129
- name: Restore ccache
116130
id: ccache-restore
@@ -124,34 +138,34 @@ jobs:
124138
125139
- name: Reset ccache stats
126140
if: matrix.packages || matrix.brew-packages
127-
run: _libmultiprocess/ci/scripts/ci_helpers.sh reset_ccache_stats
141+
run: support/ci/scripts/ci_helpers.sh reset_ccache_stats
128142

129143
- name: CMake configure
130144
env:
131145
BITCOIN_CORE_CMAKE_ARGS: ${{ matrix.cmake-args }}
132-
run: _libmultiprocess/ci/scripts/bitcoin_core_ci.sh configure_bitcoin_core
146+
run: support/ci/scripts/bitcoin_core_ci.sh configure_bitcoin_core
133147

134148
- name: Build
135-
run: _libmultiprocess/ci/scripts/bitcoin_core_ci.sh build_bitcoin_core
149+
run: support/ci/scripts/bitcoin_core_ci.sh build_bitcoin_core
136150

137151
- name: Show ccache stats
138152
if: matrix.packages || matrix.brew-packages
139-
run: _libmultiprocess/ci/scripts/ci_helpers.sh show_ccache_stats
153+
run: support/ci/scripts/ci_helpers.sh show_ccache_stats
140154

141155
- name: Run IPC unit tests
142156
env:
143157
ASAN_OPTIONS: detect_leaks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1
144158
LSAN_OPTIONS: suppressions=${{ github.workspace }}/test/sanitizer_suppressions/lsan
145159
UBSAN_OPTIONS: suppressions=${{ github.workspace }}/test/sanitizer_suppressions/ubsan:print_stacktrace=1:halt_on_error=1:report_error_type=1
146-
run: _libmultiprocess/ci/scripts/bitcoin_core_ci.sh run_ipc_unit_tests "${{ matrix.unit_test_runs }}"
160+
run: support/ci/scripts/bitcoin_core_ci.sh run_ipc_unit_tests "${{ matrix.unit_test_runs }}"
147161

148162
- name: Run IPC functional tests
149163
env:
150164
ASAN_OPTIONS: detect_leaks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1
151165
LSAN_OPTIONS: suppressions=${{ github.workspace }}/test/sanitizer_suppressions/lsan
152166
UBSAN_OPTIONS: suppressions=${{ github.workspace }}/test/sanitizer_suppressions/ubsan:print_stacktrace=1:halt_on_error=1:report_error_type=1
153167
CI_FAILFAST_TEST_LEAVE_DANGLING: 1
154-
run: _libmultiprocess/ci/scripts/bitcoin_core_ci.sh run_ipc_functional_tests "${{ matrix.functional_test_runs }}" "${{ matrix.functional_timeout_factor }}"
168+
run: support/ci/scripts/bitcoin_core_ci.sh run_ipc_functional_tests "${{ matrix.functional_test_runs }}" "${{ matrix.functional_timeout_factor }}"
155169

156170
- name: Save ccache
157171
uses: actions/cache/save@v4
@@ -201,15 +215,24 @@ jobs:
201215
uses: actions/checkout@v4
202216
with:
203217
path: _libmultiprocess
218+
ref: ${{ inputs.source_ref || github.sha }}
219+
repository: ${{ github.repository }}
220+
221+
- name: Checkout support branch
222+
uses: actions/checkout@v4
223+
with:
224+
ref: ${{ inputs.support_ref }}
225+
path: support
226+
repository: ${{ github.repository }}
204227

205228
- name: Add LLVM apt repository
206-
run: _libmultiprocess/ci/scripts/bitcoin_core_ci.sh add_llvm_apt_repository
229+
run: support/ci/scripts/bitcoin_core_ci.sh add_llvm_apt_repository
207230

208231
- name: Install packages
209-
run: _libmultiprocess/ci/scripts/bitcoin_core_ci.sh install_tsan_packages
232+
run: support/ci/scripts/bitcoin_core_ci.sh install_tsan_packages
210233

211234
- name: Determine parallelism
212-
run: _libmultiprocess/ci/scripts/ci_helpers.sh determine_parallelism "${{ matrix.nproc_multiplier }}"
235+
run: support/ci/scripts/ci_helpers.sh determine_parallelism "${{ matrix.nproc_multiplier }}"
213236

214237
- name: Restore instrumented libc++ cache
215238
id: libcxx-cache
@@ -220,11 +243,11 @@ jobs:
220243

221244
- name: Build instrumented libc++
222245
if: steps.libcxx-cache.outputs.cache-hit != 'true'
223-
run: _libmultiprocess/ci/scripts/bitcoin_core_ci.sh build_instrumented_libcxx
246+
run: support/ci/scripts/bitcoin_core_ci.sh build_instrumented_libcxx
224247

225248
- name: Determine host
226249
id: host
227-
run: _libmultiprocess/ci/scripts/ci_helpers.sh determine_host
250+
run: support/ci/scripts/ci_helpers.sh determine_host
228251

229252
- name: Restore depends cache
230253
id: depends-cache
@@ -237,7 +260,7 @@ jobs:
237260

238261
- name: Build depends (stage 1, without IPC)
239262
if: steps.depends-cache.outputs.cache-hit != 'true'
240-
run: _libmultiprocess/ci/scripts/bitcoin_core_ci.sh build_depends_without_ipc
263+
run: support/ci/scripts/bitcoin_core_ci.sh build_depends_without_ipc
241264

242265
- name: Save depends cache
243266
uses: actions/cache/save@v4
@@ -249,10 +272,10 @@ jobs:
249272
key: depends-tsan-${{ hashFiles('depends/packages/*.mk') }}-${{ env.LLVM_VERSION }}
250273

251274
- name: Replace libmultiprocess subtree
252-
run: _libmultiprocess/ci/scripts/bitcoin_core_ci.sh replace_subtree
275+
run: support/ci/scripts/bitcoin_core_ci.sh replace_subtree
253276

254277
- name: Build depends (stage 2, IPC packages including libmultiprocess)
255-
run: _libmultiprocess/ci/scripts/bitcoin_core_ci.sh build_depends_with_ipc
278+
run: support/ci/scripts/bitcoin_core_ci.sh build_depends_with_ipc
256279

257280
- name: Restore ccache
258281
id: ccache-restore
@@ -265,32 +288,32 @@ jobs:
265288
ccache-TSan-
266289
267290
- name: Reset ccache stats
268-
run: _libmultiprocess/ci/scripts/ci_helpers.sh reset_ccache_stats
291+
run: support/ci/scripts/ci_helpers.sh reset_ccache_stats
269292

270293
- name: CMake configure
271294
env:
272295
BITCOIN_CORE_CMAKE_ARGS: |-
273296
-DSANITIZERS=thread
274297
-DAPPEND_CPPFLAGS=-DARENA_DEBUG -DDEBUG_LOCKCONTENTION -D_LIBCPP_REMOVE_TRANSITIVE_INCLUDES
275298
-DCMAKE_TOOLCHAIN_FILE=depends/${{ steps.host.outputs.host }}/toolchain.cmake
276-
run: _libmultiprocess/ci/scripts/bitcoin_core_ci.sh configure_bitcoin_core
299+
run: support/ci/scripts/bitcoin_core_ci.sh configure_bitcoin_core
277300

278301
- name: Build
279-
run: _libmultiprocess/ci/scripts/bitcoin_core_ci.sh build_bitcoin_core
302+
run: support/ci/scripts/bitcoin_core_ci.sh build_bitcoin_core
280303

281304
- name: Show ccache stats
282-
run: _libmultiprocess/ci/scripts/ci_helpers.sh show_ccache_stats
305+
run: support/ci/scripts/ci_helpers.sh show_ccache_stats
283306

284307
- name: Run IPC unit tests
285308
env:
286309
LD_LIBRARY_PATH: depends/${{ steps.host.outputs.host }}/lib
287-
run: _libmultiprocess/ci/scripts/bitcoin_core_ci.sh run_ipc_unit_tests "${{ matrix.unit_test_runs }}"
310+
run: support/ci/scripts/bitcoin_core_ci.sh run_ipc_unit_tests "${{ matrix.unit_test_runs }}"
288311

289312
- name: Run IPC functional tests
290313
env:
291314
LD_LIBRARY_PATH: depends/${{ steps.host.outputs.host }}/lib
292315
CI_FAILFAST_TEST_LEAVE_DANGLING: 1
293-
run: _libmultiprocess/ci/scripts/bitcoin_core_ci.sh run_ipc_functional_tests "${{ matrix.functional_test_runs }}" "${{ matrix.functional_timeout_factor }}"
316+
run: support/ci/scripts/bitcoin_core_ci.sh run_ipc_functional_tests "${{ matrix.functional_test_runs }}" "${{ matrix.functional_timeout_factor }}"
294317

295318
- name: Save ccache
296319
uses: actions/cache/save@v4
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: CI (support branch)
2+
3+
# Trigger CI for pushes and PRs against the support branch.
4+
# Builds the C++ source from master and tests it using the CI scripts from
5+
# this branch (or PR branch), so that support branch changes can be validated.
6+
7+
on:
8+
push:
9+
pull_request:
10+
11+
jobs:
12+
ci:
13+
uses: ./.github/workflows/ci.yml
14+
with:
15+
source_ref: refs/heads/master
16+
support_ref: ${{ github.sha }}
17+
secrets: inherit
18+
19+
bitcoin-core-ci:
20+
uses: ./.github/workflows/bitcoin-core-ci.yml
21+
with:
22+
source_ref: refs/heads/master
23+
support_ref: ${{ github.sha }}
24+
secrets: inherit

0 commit comments

Comments
 (0)