Skip to content

Commit 5c9d916

Browse files
authored
Merge pull request #45 from frstrtr/ci/extension-multi-branch
ci: cover btc-embedded + dash-spv-embedded, un-gate qt build, add BTC smoke
2 parents 6ee795e + 926400d commit 5c9d916

2 files changed

Lines changed: 202 additions & 19 deletions

File tree

.github/workflows/build.yml

Lines changed: 94 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ name: CI
22

33
on:
44
push:
5-
branches: [master, windows-build, service-update]
5+
branches: [master, btc-embedded, dash-spv-embedded, windows-build, service-update]
66
tags: ['v*']
77
pull_request:
8-
branches: [master]
8+
branches: [master, btc-embedded, dash-spv-embedded]
99

1010
jobs:
1111
# ════════════════════════════════════════════════════════════════════════════
@@ -163,32 +163,34 @@ jobs:
163163
# ════════════════════════════════════════════════════════════════════════════
164164
# c2pool-qt leak-regression harness (Qt hybrid step 14, delta v1 §E.2)
165165
# Builds ui/c2pool-qt/ with C2POOL_QT_BUILD_TESTS=ON and runs the
166-
# mount/destroy × 100 harness under xvfb, asserting no orphan
167-
# QtWebEngineProcess helpers remain.
166+
# mount/destroy × 100 harness under xvfb.
168167
#
169-
# DISABLED by default. QtWebEngine 6.4.2 (Ubuntu 24.04 apt package)
170-
# segfaults inside Chromium's child-process init on GitHub's
171-
# GPU-less runners regardless of software-GL / headless / sandbox
172-
# flags — we tried LIBGL_ALWAYS_SOFTWARE, QT_OPENGL=software,
173-
# --use-gl=swiftshader, --disable-gpu, --headless=new, xvfb-run
174-
# with GLX, QTWEBENGINE_DISABLE_SANDBOX. All produced the same
175-
# 2-second-after-banner SIGSEGV. This is an environment issue,
176-
# not a harness bug — the lifecycle logic is code-verified against
177-
# PageEmbedded::destroyView + Qt parent/child semantics. The
178-
# harness compiles cleanly and is expected to pass on any
179-
# non-Wayland dev box or a self-hosted CI runner with working
180-
# QtWebEngine headless support.
168+
# PARTIAL COVERAGE. Configure + build are gating: API breakage in
169+
# PageEmbedded::destroyView or its Qt dependencies will fail compile
170+
# and block merge. That alone catches the most common class of
171+
# regression (a refactor renaming/removing a destroyView hook).
181172
#
182-
# To re-enable, flip `if: false` → `if: true` (or remove the
183-
# guard) once one of:
173+
# The runtime mount/destroy × 100 step is `continue-on-error: true`
174+
# because QtWebEngine 6.4.2 (Ubuntu 24.04 apt package) segfaults
175+
# inside Chromium's child-process init on GitHub's GPU-less runners
176+
# regardless of software-GL / headless / sandbox flags — tried
177+
# LIBGL_ALWAYS_SOFTWARE, QT_OPENGL=software, --use-gl=swiftshader,
178+
# --disable-gpu, --headless=new, xvfb-run with GLX,
179+
# QTWEBENGINE_DISABLE_SANDBOX. All produce the same 2-second-after-
180+
# banner SIGSEGV. The lifecycle logic is code-verified against
181+
# PageEmbedded::destroyView + Qt parent/child semantics; the harness
182+
# is expected to pass on any non-Wayland dev box or a self-hosted CI
183+
# runner with working QtWebEngine headless support.
184+
#
185+
# To flip the runtime step back to gating, remove `continue-on-error: true`
186+
# once one of:
184187
# - Ubuntu PPA ships QtWebEngine ≥ 6.6 with better headless
185188
# - Self-hosted runner with a working Qt6 WebEngine is available
186189
# - Alternative harness drops QWebEngineView mount (mocks the
187190
# Chromium init) while still exercising destroyView lifecycle
188191
# ════════════════════════════════════════════════════════════════════════════
189192
qt-webengine:
190193
name: Qt WebEngine leak gate
191-
if: false
192194
runs-on: ubuntu-24.04
193195
steps:
194196
- uses: actions/checkout@v6
@@ -213,6 +215,7 @@ jobs:
213215
run: cmake --build build-qt --target c2pool-qt_test_embedded_leak -j$(nproc)
214216

215217
- name: Run leak harness under xvfb
218+
continue-on-error: true
216219
env:
217220
QTWEBENGINE_DISABLE_SANDBOX: '1'
218221
# Force software GL throughout — the GitHub Ubuntu runner
@@ -236,6 +239,78 @@ jobs:
236239
xvfb-run -a --server-args="-screen 0 1280x800x24 +extension GLX +render -noreset" \
237240
timeout 180 ./build-qt/c2pool-qt_test_embedded_leak
238241
242+
# ════════════════════════════════════════════════════════════════════════════
243+
# BTC embedded smoke (c2pool-btc target)
244+
#
245+
# Gated to runs where the btc-embedded branch is involved — pushes to
246+
# btc-embedded, or PRs whose head or base is btc-embedded. On master
247+
# itself the BTC sources don't yet exist (src/c2pool/main_btc.cpp,
248+
# src/impl/btc/) so this job is intentionally a no-op there; it
249+
# activates as soon as this workflow lands on btc-embedded via merge.
250+
#
251+
# Coverage: cmake --build --target c2pool-btc catches any link/compile
252+
# breakage in the embedded BTC SPV binary (main_btc.cpp + btc module +
253+
# btc_stratum + transitive ltc dependency). Until this CI job existed,
254+
# BTC had ZERO automated coverage on any commit.
255+
#
256+
# Deferred to a follow-up PR landing on btc-embedded directly:
257+
# - src/impl/btc/test/share_test.cpp: `add_subdirectory(test)` is
258+
# commented out in src/impl/btc/CMakeLists.txt because the test
259+
# still references LTC types. Revival is owned by the btc-heap-opt
260+
# arc.
261+
# - src/impl/btc/test/template_parity_test.cpp: standalone consensus
262+
# oracle harness; the file header claims it builds with a bare g++
263+
# invocation but its transitive includes pull in nlohmann_json,
264+
# leveldb_store, core/log — needs proper CMake target wiring to be
265+
# reliable in CI.
266+
# ════════════════════════════════════════════════════════════════════════════
267+
btc-linux:
268+
name: BTC embedded smoke (Linux x86_64)
269+
if: |
270+
github.ref == 'refs/heads/btc-embedded' ||
271+
github.head_ref == 'btc-embedded' ||
272+
github.base_ref == 'btc-embedded'
273+
runs-on: ubuntu-24.04
274+
steps:
275+
- uses: actions/checkout@v6
276+
277+
- name: Install system dependencies
278+
run: |
279+
sudo apt-get update -qq
280+
sudo apt-get install -y --no-install-recommends \
281+
g++ cmake make libleveldb-dev libsecp256k1-dev
282+
283+
- uses: actions/setup-python@v6
284+
with: { python-version: '3.12' }
285+
286+
- name: Install Conan 2
287+
run: pip install "conan>=2.0,<3.0"
288+
289+
- name: Detect Conan profile
290+
run: |
291+
conan profile detect --force
292+
sed -i 's/compiler.cppstd=.*/compiler.cppstd=20/' "$(conan profile path default)"
293+
294+
- name: Restore Conan cache
295+
uses: actions/cache@v5
296+
with:
297+
path: ~/.conan2
298+
key: conan2-ubuntu24-gcc13-${{ hashFiles('conanfile.txt') }}
299+
300+
- name: Conan install
301+
run: conan install . --build=missing --output-folder=build_btc --settings=build_type=Release
302+
303+
- name: Configure
304+
run: cmake -S . -B build_btc -DCMAKE_TOOLCHAIN_FILE=build_btc/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release
305+
306+
- name: Build c2pool-btc
307+
run: cmake --build build_btc --target c2pool-btc -j$(nproc)
308+
309+
- name: Verify binary
310+
run: |
311+
file build_btc/src/c2pool/c2pool-btc
312+
build_btc/src/c2pool/c2pool-btc --help 2>&1 | head -3 || true
313+
239314
# ════════════════════════════════════════════════════════════════════════════
240315
# macOS (Apple Silicon arm64 — GitHub only provides ARM runners now)
241316
# Intel x86_64 macOS binary is built locally; see doc/build-macos.md

.github/workflows/coin-matrix.yml

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
name: Coin matrix
2+
3+
# Per the multi-coin landing strategy (2026-05-24): every PR builds AND
4+
# smoke-tests every coin binary that exists on the branch. A core change
5+
# that regresses any coin fails at PR review time, not weeks later at
6+
# merge. This is what makes single-master safe — human cross-coin review
7+
# does not scale.
8+
#
9+
# Forward-compatible: each coin's job activates when src/c2pool/main_<coin>.cpp
10+
# + src/impl/<coin>/ are present. On master today only `btc` will run
11+
# (when this lands on master via Bucket-B's CMake glue + main_<coin>.cpp
12+
# split, the other coins activate automatically without YAML changes).
13+
14+
on:
15+
push:
16+
branches: [master, btc-embedded, dash-spv-embedded, windows-build, service-update]
17+
pull_request:
18+
branches: [master, btc-embedded, dash-spv-embedded]
19+
20+
jobs:
21+
coin:
22+
name: ${{ matrix.coin }} smoke (Linux x86_64)
23+
runs-on: ubuntu-24.04
24+
strategy:
25+
fail-fast: false
26+
matrix:
27+
coin: [ltc, doge, dash, btc]
28+
steps:
29+
- uses: actions/checkout@v6
30+
31+
- name: Check source presence
32+
id: presence
33+
run: |
34+
if [ -f "src/c2pool/main_${{ matrix.coin }}.cpp" ] && [ -d "src/impl/${{ matrix.coin }}" ]; then
35+
echo "exists=1" >> "$GITHUB_OUTPUT"
36+
echo "::notice::c2pool-${{ matrix.coin }} source present — building."
37+
else
38+
echo "exists=0" >> "$GITHUB_OUTPUT"
39+
echo "::notice::c2pool-${{ matrix.coin }} source not on this branch — skipping (expected until that coin's split lands)."
40+
fi
41+
42+
- name: Install system dependencies
43+
if: steps.presence.outputs.exists == '1'
44+
run: |
45+
sudo apt-get update -qq
46+
sudo apt-get install -y --no-install-recommends \
47+
g++ cmake make libleveldb-dev libsecp256k1-dev
48+
49+
- uses: actions/setup-python@v6
50+
if: steps.presence.outputs.exists == '1'
51+
with: { python-version: '3.12' }
52+
53+
- name: Install Conan 2
54+
if: steps.presence.outputs.exists == '1'
55+
run: pip install "conan>=2.0,<3.0"
56+
57+
- name: Detect Conan profile
58+
if: steps.presence.outputs.exists == '1'
59+
run: |
60+
conan profile detect --force
61+
sed -i 's/compiler.cppstd=.*/compiler.cppstd=20/' "$(conan profile path default)"
62+
63+
- name: Restore Conan cache
64+
if: steps.presence.outputs.exists == '1'
65+
uses: actions/cache@v5
66+
with:
67+
path: ~/.conan2
68+
key: conan2-ubuntu24-gcc13-${{ matrix.coin }}-${{ hashFiles('conanfile.txt') }}
69+
restore-keys: |
70+
conan2-ubuntu24-gcc13-${{ matrix.coin }}-
71+
conan2-ubuntu24-gcc13-
72+
73+
- name: Conan install
74+
if: steps.presence.outputs.exists == '1'
75+
run: |
76+
conan install . \
77+
--build=missing \
78+
--output-folder=build_${{ matrix.coin }} \
79+
--settings=build_type=Release
80+
81+
- name: Configure
82+
if: steps.presence.outputs.exists == '1'
83+
run: |
84+
cmake -S . -B build_${{ matrix.coin }} \
85+
-DCMAKE_TOOLCHAIN_FILE=build_${{ matrix.coin }}/conan_toolchain.cmake \
86+
-DCMAKE_BUILD_TYPE=Release
87+
88+
- name: Build c2pool-${{ matrix.coin }}
89+
if: steps.presence.outputs.exists == '1'
90+
run: cmake --build build_${{ matrix.coin }} --target c2pool-${{ matrix.coin }} -j$(nproc)
91+
92+
- name: Smoke test (--help)
93+
if: steps.presence.outputs.exists == '1'
94+
run: |
95+
BIN=build_${{ matrix.coin }}/src/c2pool/c2pool-${{ matrix.coin }}
96+
file "$BIN"
97+
"$BIN" --help 2>&1 | head -5 || true
98+
99+
- name: Upload build artifacts on failure
100+
if: failure() && steps.presence.outputs.exists == '1'
101+
uses: actions/upload-artifact@v7
102+
with:
103+
name: coin-matrix-${{ matrix.coin }}-fail
104+
path: |
105+
build_${{ matrix.coin }}/CMakeFiles/CMakeOutput.log
106+
build_${{ matrix.coin }}/CMakeFiles/CMakeError.log
107+
retention-days: 7
108+
if-no-files-found: ignore

0 commit comments

Comments
 (0)