From 2fc9cd4b8337fffde810e3c97c8ad1e1ceba6ddc Mon Sep 17 00:00:00 2001 From: Alec Muffett Date: Sun, 24 May 2026 19:34:33 +0400 Subject: [PATCH 1/2] ci: extend triggers + un-gate qt build + add BTC smoke job MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - push/PR triggers now cover btc-embedded and dash-spv-embedded. Previously only PRs to master triggered CI on those branches; direct pushes to either branch had no coverage at all. - qt-webengine job no longer gated by `if: false`. Configure + Build steps run unconditionally (catches PageEmbedded API breakage). The runtime mount/destroy x100 step is marked continue-on-error so the known QtWebEngine 6.4.2 + GPU-less-runner SIGSEGV doesn't block merges while still surfacing if a future Qt bump fixes it. - New btc-linux job builds c2pool-btc target as smoke coverage for the embedded BTC SPV binary. Gated to runs where btc-embedded is the push ref, PR head, or PR base — no-op on master itself (where the BTC sources don't exist). Activates when this workflow flows into btc-embedded via merge. BTC previously had zero automated coverage. share_test.cpp and template_parity_test.cpp under src/impl/btc/test/ are deferred to a follow-up on btc-embedded that re-enables add_subdirectory(test) and gives template_parity proper CMake plumbing. --- .github/workflows/build.yml | 113 ++++++++++++++++++++++++++++++------ 1 file changed, 94 insertions(+), 19 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1f38bcf9a..d90ee0cdc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,10 +2,10 @@ name: CI on: push: - branches: [master, windows-build, service-update] + branches: [master, btc-embedded, dash-spv-embedded, windows-build, service-update] tags: ['v*'] pull_request: - branches: [master] + branches: [master, btc-embedded, dash-spv-embedded] jobs: # ════════════════════════════════════════════════════════════════════════════ @@ -163,24 +163,27 @@ jobs: # ════════════════════════════════════════════════════════════════════════════ # c2pool-qt leak-regression harness (Qt hybrid step 14, delta v1 §E.2) # Builds ui/c2pool-qt/ with C2POOL_QT_BUILD_TESTS=ON and runs the - # mount/destroy × 100 harness under xvfb, asserting no orphan - # QtWebEngineProcess helpers remain. + # mount/destroy × 100 harness under xvfb. # - # DISABLED by default. QtWebEngine 6.4.2 (Ubuntu 24.04 apt package) - # segfaults inside Chromium's child-process init on GitHub's - # GPU-less runners regardless of software-GL / headless / sandbox - # flags — we tried LIBGL_ALWAYS_SOFTWARE, QT_OPENGL=software, - # --use-gl=swiftshader, --disable-gpu, --headless=new, xvfb-run - # with GLX, QTWEBENGINE_DISABLE_SANDBOX. All produced the same - # 2-second-after-banner SIGSEGV. This is an environment issue, - # not a harness bug — the lifecycle logic is code-verified against - # PageEmbedded::destroyView + Qt parent/child semantics. The - # harness compiles cleanly and is expected to pass on any - # non-Wayland dev box or a self-hosted CI runner with working - # QtWebEngine headless support. + # PARTIAL COVERAGE. Configure + build are gating: API breakage in + # PageEmbedded::destroyView or its Qt dependencies will fail compile + # and block merge. That alone catches the most common class of + # regression (a refactor renaming/removing a destroyView hook). # - # To re-enable, flip `if: false` → `if: true` (or remove the - # guard) once one of: + # The runtime mount/destroy × 100 step is `continue-on-error: true` + # because QtWebEngine 6.4.2 (Ubuntu 24.04 apt package) segfaults + # inside Chromium's child-process init on GitHub's GPU-less runners + # regardless of software-GL / headless / sandbox flags — tried + # LIBGL_ALWAYS_SOFTWARE, QT_OPENGL=software, --use-gl=swiftshader, + # --disable-gpu, --headless=new, xvfb-run with GLX, + # QTWEBENGINE_DISABLE_SANDBOX. All produce the same 2-second-after- + # banner SIGSEGV. The lifecycle logic is code-verified against + # PageEmbedded::destroyView + Qt parent/child semantics; the harness + # is expected to pass on any non-Wayland dev box or a self-hosted CI + # runner with working QtWebEngine headless support. + # + # To flip the runtime step back to gating, remove `continue-on-error: true` + # once one of: # - Ubuntu PPA ships QtWebEngine ≥ 6.6 with better headless # - Self-hosted runner with a working Qt6 WebEngine is available # - Alternative harness drops QWebEngineView mount (mocks the @@ -188,7 +191,6 @@ jobs: # ════════════════════════════════════════════════════════════════════════════ qt-webengine: name: Qt WebEngine leak gate - if: false runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v6 @@ -213,6 +215,7 @@ jobs: run: cmake --build build-qt --target c2pool-qt_test_embedded_leak -j$(nproc) - name: Run leak harness under xvfb + continue-on-error: true env: QTWEBENGINE_DISABLE_SANDBOX: '1' # Force software GL throughout — the GitHub Ubuntu runner @@ -236,6 +239,78 @@ jobs: xvfb-run -a --server-args="-screen 0 1280x800x24 +extension GLX +render -noreset" \ timeout 180 ./build-qt/c2pool-qt_test_embedded_leak + # ════════════════════════════════════════════════════════════════════════════ + # BTC embedded smoke (c2pool-btc target) + # + # Gated to runs where the btc-embedded branch is involved — pushes to + # btc-embedded, or PRs whose head or base is btc-embedded. On master + # itself the BTC sources don't yet exist (src/c2pool/main_btc.cpp, + # src/impl/btc/) so this job is intentionally a no-op there; it + # activates as soon as this workflow lands on btc-embedded via merge. + # + # Coverage: cmake --build --target c2pool-btc catches any link/compile + # breakage in the embedded BTC SPV binary (main_btc.cpp + btc module + + # btc_stratum + transitive ltc dependency). Until this CI job existed, + # BTC had ZERO automated coverage on any commit. + # + # Deferred to a follow-up PR landing on btc-embedded directly: + # - src/impl/btc/test/share_test.cpp: `add_subdirectory(test)` is + # commented out in src/impl/btc/CMakeLists.txt because the test + # still references LTC types. Revival is owned by the btc-heap-opt + # arc. + # - src/impl/btc/test/template_parity_test.cpp: standalone consensus + # oracle harness; the file header claims it builds with a bare g++ + # invocation but its transitive includes pull in nlohmann_json, + # leveldb_store, core/log — needs proper CMake target wiring to be + # reliable in CI. + # ════════════════════════════════════════════════════════════════════════════ + btc-linux: + name: BTC embedded smoke (Linux x86_64) + if: | + github.ref == 'refs/heads/btc-embedded' || + github.head_ref == 'btc-embedded' || + github.base_ref == 'btc-embedded' + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v6 + + - name: Install system dependencies + run: | + sudo apt-get update -qq + sudo apt-get install -y --no-install-recommends \ + g++ cmake make libleveldb-dev libsecp256k1-dev + + - uses: actions/setup-python@v6 + with: { python-version: '3.12' } + + - name: Install Conan 2 + run: pip install "conan>=2.0,<3.0" + + - name: Detect Conan profile + run: | + conan profile detect --force + sed -i 's/compiler.cppstd=.*/compiler.cppstd=20/' "$(conan profile path default)" + + - name: Restore Conan cache + uses: actions/cache@v5 + with: + path: ~/.conan2 + key: conan2-ubuntu24-gcc13-${{ hashFiles('conanfile.txt') }} + + - name: Conan install + run: conan install . --build=missing --output-folder=build_btc --settings=build_type=Release + + - name: Configure + run: cmake -S . -B build_btc -DCMAKE_TOOLCHAIN_FILE=build_btc/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release + + - name: Build c2pool-btc + run: cmake --build build_btc --target c2pool-btc -j$(nproc) + + - name: Verify binary + run: | + file build_btc/src/c2pool/c2pool-btc + build_btc/src/c2pool/c2pool-btc --help 2>&1 | head -3 || true + # ════════════════════════════════════════════════════════════════════════════ # macOS (Apple Silicon arm64 — GitHub only provides ARM runners now) # Intel x86_64 macOS binary is built locally; see doc/build-macos.md From 926400d12ff6a2ca82172b10737904afef57fe20 Mon Sep 17 00:00:00 2001 From: Alec Muffett Date: Wed, 27 May 2026 02:16:05 +0400 Subject: [PATCH 2/2] ci: add coin-matrix workflow (rule 2 from multi-coin landing strategy) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Per the 2026-05-24 multi-coin landing strategy: every PR builds and smoke-tests every coin binary that exists on the branch. Forward- compatible — each coin's job activates when src/c2pool/main_.cpp and src/impl// are both present. On master today all four entries skip with a notice; the matrix activates per coin as their splits land (btc via the embedded branch; dash via Bucket-B; ltc/doge once main_.cpp is split out from the legacy c2pool binary). Triggers and tooling versions match build.yml for consistency. The existing btc-linux: job in build.yml becomes redundant once this covers btc on the btc-embedded branch; delete in a follow-up. --- .github/workflows/coin-matrix.yml | 108 ++++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 .github/workflows/coin-matrix.yml diff --git a/.github/workflows/coin-matrix.yml b/.github/workflows/coin-matrix.yml new file mode 100644 index 000000000..8dcb3c944 --- /dev/null +++ b/.github/workflows/coin-matrix.yml @@ -0,0 +1,108 @@ +name: Coin matrix + +# Per the multi-coin landing strategy (2026-05-24): every PR builds AND +# smoke-tests every coin binary that exists on the branch. A core change +# that regresses any coin fails at PR review time, not weeks later at +# merge. This is what makes single-master safe — human cross-coin review +# does not scale. +# +# Forward-compatible: each coin's job activates when src/c2pool/main_.cpp +# + src/impl// are present. On master today only `btc` will run +# (when this lands on master via Bucket-B's CMake glue + main_.cpp +# split, the other coins activate automatically without YAML changes). + +on: + push: + branches: [master, btc-embedded, dash-spv-embedded, windows-build, service-update] + pull_request: + branches: [master, btc-embedded, dash-spv-embedded] + +jobs: + coin: + name: ${{ matrix.coin }} smoke (Linux x86_64) + runs-on: ubuntu-24.04 + strategy: + fail-fast: false + matrix: + coin: [ltc, doge, dash, btc] + steps: + - uses: actions/checkout@v6 + + - name: Check source presence + id: presence + run: | + if [ -f "src/c2pool/main_${{ matrix.coin }}.cpp" ] && [ -d "src/impl/${{ matrix.coin }}" ]; then + echo "exists=1" >> "$GITHUB_OUTPUT" + echo "::notice::c2pool-${{ matrix.coin }} source present — building." + else + echo "exists=0" >> "$GITHUB_OUTPUT" + echo "::notice::c2pool-${{ matrix.coin }} source not on this branch — skipping (expected until that coin's split lands)." + fi + + - name: Install system dependencies + if: steps.presence.outputs.exists == '1' + run: | + sudo apt-get update -qq + sudo apt-get install -y --no-install-recommends \ + g++ cmake make libleveldb-dev libsecp256k1-dev + + - uses: actions/setup-python@v6 + if: steps.presence.outputs.exists == '1' + with: { python-version: '3.12' } + + - name: Install Conan 2 + if: steps.presence.outputs.exists == '1' + run: pip install "conan>=2.0,<3.0" + + - name: Detect Conan profile + if: steps.presence.outputs.exists == '1' + run: | + conan profile detect --force + sed -i 's/compiler.cppstd=.*/compiler.cppstd=20/' "$(conan profile path default)" + + - name: Restore Conan cache + if: steps.presence.outputs.exists == '1' + uses: actions/cache@v5 + with: + path: ~/.conan2 + key: conan2-ubuntu24-gcc13-${{ matrix.coin }}-${{ hashFiles('conanfile.txt') }} + restore-keys: | + conan2-ubuntu24-gcc13-${{ matrix.coin }}- + conan2-ubuntu24-gcc13- + + - name: Conan install + if: steps.presence.outputs.exists == '1' + run: | + conan install . \ + --build=missing \ + --output-folder=build_${{ matrix.coin }} \ + --settings=build_type=Release + + - name: Configure + if: steps.presence.outputs.exists == '1' + run: | + cmake -S . -B build_${{ matrix.coin }} \ + -DCMAKE_TOOLCHAIN_FILE=build_${{ matrix.coin }}/conan_toolchain.cmake \ + -DCMAKE_BUILD_TYPE=Release + + - name: Build c2pool-${{ matrix.coin }} + if: steps.presence.outputs.exists == '1' + run: cmake --build build_${{ matrix.coin }} --target c2pool-${{ matrix.coin }} -j$(nproc) + + - name: Smoke test (--help) + if: steps.presence.outputs.exists == '1' + run: | + BIN=build_${{ matrix.coin }}/src/c2pool/c2pool-${{ matrix.coin }} + file "$BIN" + "$BIN" --help 2>&1 | head -5 || true + + - name: Upload build artifacts on failure + if: failure() && steps.presence.outputs.exists == '1' + uses: actions/upload-artifact@v7 + with: + name: coin-matrix-${{ matrix.coin }}-fail + path: | + build_${{ matrix.coin }}/CMakeFiles/CMakeOutput.log + build_${{ matrix.coin }}/CMakeFiles/CMakeError.log + retention-days: 7 + if-no-files-found: ignore