From b1bdf6404fde56d717e87b17f5181fa260cc7adb Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 11 Feb 2026 15:55:44 +1030 Subject: [PATCH 01/10] CI: run my jobs on self-hosted runners. This is horrible. We cannot make GH fallback, so I simply made it use self-hosted runners for me. If they're down, that's my problem :( Nonetheless, the gcc compile step (for example) goes from 9m38s to 5m32. Signed-off-by: Rusty Russell --- .github/workflows/ci.yaml | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 7dda61720455..c5de62b51bbc 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -22,7 +22,10 @@ env: jobs: prebuild: name: Pre-build checks - runs-on: ubuntu-24.04 + runs-on: &prefer-self-hosted > + ${{ github.actor == 'rustyrussell' + && fromJSON('["self-hosted","rusty"]') + || 'ubuntu-24.04' }} timeout-minutes: 120 if: | github.event.action != 'edited' || @@ -108,7 +111,7 @@ jobs: compile: name: Compile CLN ${{ matrix.cfg }} - runs-on: ubuntu-24.04 + runs-on: *prefer-self-hosted timeout-minutes: 30 needs: - prebuild @@ -175,7 +178,7 @@ jobs: # The unit test checks are not in the critical path (not dependent # on the integration tests), so run them with `valgrind` name: Run unit tests - runs-on: ubuntu-24.04 + runs-on: *prefer-self-hosted timeout-minutes: 60 env: BOLTDIR: bolts @@ -220,7 +223,7 @@ jobs: check-fuzz: name: Run fuzz regression tests - runs-on: ubuntu-24.04 + runs-on: *prefer-self-hosted needs: - prebuild steps: @@ -246,7 +249,7 @@ jobs: check-downgrade: name: Check we can downgrade the node - runs-on: ubuntu-24.04 + runs-on: *prefer-self-hosted needs: - compile strategy: @@ -334,7 +337,7 @@ jobs: integration: name: Test CLN ${{ matrix.name }} - runs-on: ubuntu-24.04 + runs-on: *prefer-self-hosted timeout-minutes: 120 env: RUST_PROFILE: release # Has to match the one in the compile step @@ -449,7 +452,7 @@ jobs: integration-valgrind: name: Valgrind Test CLN ${{ matrix.name }} - runs-on: ubuntu-24.04 + runs-on: *prefer-self-hosted timeout-minutes: 120 env: RUST_PROFILE: release # Has to match the one in the compile step @@ -537,7 +540,7 @@ jobs: integration-sanitizers: name: Sanitizers Test CLN - runs-on: ubuntu-24.04 + runs-on: *prefer-self-hosted timeout-minutes: 120 env: RUST_PROFILE: release @@ -629,7 +632,7 @@ jobs: update-docs-examples: name: Update examples in doc schemas (disabled temporarily!) if: false - runs-on: ubuntu-24.04 + runs-on: *prefer-self-hosted timeout-minutes: 30 strategy: fail-fast: false @@ -678,7 +681,7 @@ jobs: min-btc-support: name: Test minimum supported BTC v${{ matrix.MIN_BTC_VERSION }} with ${{ matrix.NAME }} - runs-on: ubuntu-24.04 + runs-on: *prefer-self-hosted timeout-minutes: 120 env: RUST_PROFILE: release # Has to match the one in the compile step From 45791c191eb6a179c79b08b9776c24e091969fce Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 11 Feb 2026 15:56:44 +1030 Subject: [PATCH 02/10] CI: use nproc + 1 for pytest parallelism.. More future proof, better for self-hosted runners. Signed-off-by: Rusty Russell --- .github/workflows/ci.yaml | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c5de62b51bbc..6cfbf3c47a99 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -96,7 +96,7 @@ jobs: VALGRIND: 0 PYTEST_OPTS: ${{ env.PYTEST_OPTS_BASE }} run: | - uv run make check-source BASE_REF="origin/${{ github.base_ref }}" + uv run make -j $(nproc) check-source BASE_REF="origin/${{ github.base_ref }}" - name: Upload test results if: always() uses: actions/upload-artifact@v4 @@ -315,7 +315,6 @@ jobs: - name: Test env: SLOW_MACHINE: 1 - PYTEST_PAR: 4 TEST_DEBUG: 1 TEST_DB_PROVIDER: ${{ matrix.TEST_DB_PROVIDER }} TEST_NETWORK: ${{ matrix.TEST_NETWORK }} @@ -326,7 +325,7 @@ jobs: run: | env cat config.vars - uv run eatmydata pytest tests/test_downgrade.py -n ${PYTEST_PAR} ${PYTEST_OPTS} + uv run eatmydata pytest tests/test_downgrade.py -n $(($(nproc) + 1)) ${PYTEST_OPTS} - name: Upload test results if: always() uses: actions/upload-artifact@v4 @@ -433,7 +432,6 @@ jobs: COMPAT: 1 CFG: ${{ matrix.CFG }} SLOW_MACHINE: 1 - PYTEST_PAR: 4 TEST_DEBUG: 1 TEST_DB_PROVIDER: ${{ matrix.TEST_DB_PROVIDER }} TEST_NETWORK: ${{ matrix.TEST_NETWORK }} @@ -441,7 +439,7 @@ jobs: run: | env cat config.vars - VALGRIND=0 uv run eatmydata pytest tests/ -n ${PYTEST_PAR} ${PYTEST_OPTS} + VALGRIND=0 uv run eatmydata pytest tests/ -n $(($(nproc) + 1)) ${PYTEST_OPTS} - name: Upload test results if: always() uses: actions/upload-artifact@v4 @@ -527,9 +525,8 @@ jobs: env: SLOW_MACHINE: 1 TEST_DEBUG: 1 - PYTEST_PAR: 2 run: | - VALGRIND=1 uv run eatmydata pytest tests/ -n ${PYTEST_PAR} ${PYTEST_OPTS} ${{ matrix.PYTEST_OPTS }} + VALGRIND=1 uv run eatmydata pytest tests/ -n $(($(nproc) + 1)) ${PYTEST_OPTS} ${{ matrix.PYTEST_OPTS }} - name: Upload test results if: always() uses: actions/upload-artifact@v4 @@ -617,10 +614,8 @@ jobs: run: tar -xvjf cln-compile-clang-sanitizers.tar.bz2 - name: Test - env: - PYTEST_PAR: 2 run: | - uv run eatmydata pytest tests/ -n ${PYTEST_PAR} ${PYTEST_OPTS} ${{ matrix.PYTEST_OPTS }} + uv run eatmydata pytest tests/ -n $(($(nproc) + 1)) ${PYTEST_OPTS} ${{ matrix.PYTEST_OPTS }} - name: Upload test results if: always() uses: actions/upload-artifact@v4 @@ -670,7 +665,7 @@ jobs: tar -xaf cln-compile-gcc.tar.bz2 - name: Test run: | - uv run eatmydata make -j $(nproc) check-doc-examples + uv run eatmydata make -j $(($(nproc) + 1)) check-doc-examples - name: Upload test results if: always() uses: actions/upload-artifact@v4 @@ -743,7 +738,6 @@ jobs: COMPAT: 1 CFG: ${{ matrix.CFG }} SLOW_MACHINE: 1 - PYTEST_PAR: 4 TEST_DEBUG: 1 TEST_DB_PROVIDER: ${{ matrix.TEST_DB_PROVIDER }} TEST_NETWORK: ${{ matrix.TEST_NETWORK }} @@ -751,7 +745,7 @@ jobs: run: | env cat config.vars - VALGRIND=0 uv run eatmydata pytest tests/ -n ${PYTEST_PAR} ${PYTEST_OPTS} + VALGRIND=0 uv run eatmydata pytest tests/ -n $(($(nproc) + 1)) ${PYTEST_OPTS} - name: Upload test results if: always() uses: actions/upload-artifact@v4 From e3edc71db0b7c85f6f2c70d300036d0c03ea8539 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 11 Feb 2026 15:56:59 +1030 Subject: [PATCH 03/10] Makefile: don't build the sources in make check-source. check-source-bolt needs devtools, and check-python needs a full build. Signed-off-by: Rusty Russell --- .github/workflows/ci.yaml | 46 ++++++++++++++++++++++++++++++++++----- Makefile | 6 ++--- common/Makefile | 4 ++-- 3 files changed, 45 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 6cfbf3c47a99..a0aea42d5c02 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -104,10 +104,6 @@ jobs: name: pytest-results-prebuild path: report.xml if-no-files-found: ignore - - name: Check Generated Files have been updated - run: uv run make check-gen-updated - - name: Check docs - run: uv run make check-doc compile: name: Compile CLN ${{ matrix.cfg }} @@ -174,6 +170,44 @@ jobs: name: cln-${{ matrix.CFG }}.tar.bz2 path: cln-${{ matrix.CFG }}.tar.bz2 + check-compiled-source: + runs-on: > + ${{ github.actor == 'rustyrussell' + && fromJSON('["self-hosted","rusty"]') + || 'ubuntu-24.04' }} + needs: + - compile + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Python 3.10 + uses: actions/setup-python@v5 + with: + python-version: "3.10" + + - name: Install uv + uses: astral-sh/setup-uv@v5 + + - name: Install dependencies + run: | + bash -x .github/scripts/setup.sh + + - name: Download build + uses: actions/download-artifact@v4 + with: + name: cln-compile-gcc.tar.bz2 + + - name: Unpack pre-built CLN + env: + CFG: ${{ matrix.CFG }} + run: | + tar -xaf cln-compile-gcc.tar.bz2 + + - name: Check + run: | + uv run eatmydata make -j $(nproc) check-source-bolt check-python check-gen-updated check-doc + check-units: # The unit test checks are not in the critical path (not dependent # on the integration tests), so run them with `valgrind` @@ -768,11 +802,12 @@ jobs: - integration-sanitizers - min-btc-support - check-downgrade + - check-compiled-source if: ${{ always() }} steps: - name: Complete env: - JOB_NAMES: "INTEGRATION CHECK_UNITS VALGRIND SANITIZERS BTC" + JOB_NAMES: "INTEGRATION CHECK_UNITS VALGRIND SANITIZERS BTC CHECK_COMPILED_SOURCE" INTEGRATION: ${{ needs.integration.result }} CHECK_UNITS: ${{ needs['check-units'].result }} VALGRIND: ${{ needs['integration-valgrind'].result }} @@ -780,6 +815,7 @@ jobs: DOCS: ${{ needs['update-docs-examples'].result }} BTC: ${{ needs['min-btc-support'].result }} CHECK_DOWNGRADE: ${{ needs['check-downgrade'].result }} + CHECK_COMPILED_SOURCE: ${{ needs['check-compiled-source'].result }} run: | failed="" for name in $JOB_NAMES; do diff --git a/Makefile b/Makefile index fd6c8aa7a203..7901023ed551 100644 --- a/Makefile +++ b/Makefile @@ -643,10 +643,8 @@ update-doc-examples: check-doc-examples: update-doc-examples git diff --exit-code HEAD -# For those without working cppcheck -check-source-no-cppcheck: check-makefile check-source-bolt check-whitespace check-spelling check-python check-includes check-shellcheck check-setup_locale check-tmpctx check-discouraged-functions check-amount-access check-bad-sprintf - -check-source: check-source-no-cppcheck +# This should NOT compile things! +check-source: check-makefile check-whitespace check-spelling check-python-flake8 check-includes check-shellcheck check-setup_locale check-tmpctx check-discouraged-functions check-amount-access check-bad-sprintf full-check: check check-source diff --git a/common/Makefile b/common/Makefile index 333e3321cb6a..adf23ed02d29 100644 --- a/common/Makefile +++ b/common/Makefile @@ -159,8 +159,8 @@ common/htlc_state_names_gen.h: common/htlc_state.h ccan/ccan/cdump/tools/cdump-e common/gossip_store.o: gossipd/gossip_store_wiregen.h -check-source-bolt: $(COMMON_SRC_NOGEN:%=bolt-check/%) $(COMMON_HEADERS:%=bolt-check/%) -check-whitespace: $(COMMON_SRC_NOGEN:%=check-whitespace/%) $(COMMON_HEADERS:%=check-whitespace/%) +check-source-bolt: $(COMMON_SRC_NOGEN:%=bolt-check/%) $(COMMON_HEADERS_NOGEN:%=bolt-check/%) +check-whitespace: $(COMMON_SRC_NOGEN:%=check-whitespace/%) $(COMMON_HEADERS_NOGEN:%=check-whitespace/%) clean: common-clean From 4739ecb0cfb50766ca4f3c77394b3b473493e0bd Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 11 Feb 2026 16:08:25 +1030 Subject: [PATCH 04/10] CI: if a runner is labelled "no-setup" don't run setup.sh The one thing we *should* run is uv sync, so we do that in the scripts. This saves about 1m32, for *every* task. Signed-off-by: Rusty Russell --- .github/scripts/setup.sh | 11 +++++++---- .github/workflows/ci.yaml | 15 ++++++++++++--- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/.github/scripts/setup.sh b/.github/scripts/setup.sh index 2409cdf0d543..f87cb486e1a4 100755 --- a/.github/scripts/setup.sh +++ b/.github/scripts/setup.sh @@ -3,6 +3,13 @@ set -e export DEBIAN_FRONTEND=noninteractive export RUST_VERSION=stable +# If you have your own runner, you can pre-setup and avoid this +# (also means you don't need to allow sudo!) +if [ -f "$HOME"/runner-no-setup ]; then + echo "Runner does not need setup, skipping" + exit 0 +fi + sudo useradd -ms /bin/bash tester sudo apt-get update -qq @@ -67,10 +74,6 @@ sudo chmod 0440 /etc/sudoers.d/tester curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- \ -y --default-toolchain ${RUST_VERSION} -uv sync --all-extras --all-groups -# required for reckless till poetry to uv migration -uv tool install poetry - # We also need a relatively recent protobuf-compiler, at least 3.12.0, # in order to support the experimental `optional` flag. diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a0aea42d5c02..7f76ecf5bb25 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -87,6 +87,7 @@ jobs: - name: Install dependencies run: | bash -x .github/scripts/setup.sh + uv sync --all-extras --all-groups # We're going to check BOLT quotes, so get the latest version git clone https://github.com/lightning/bolts.git ../${BOLTDIR} - name: Configure @@ -146,6 +147,7 @@ jobs: - name: Install dependencies run: | bash -x .github/scripts/setup.sh + uv sync --all-extras --all-groups - name: Build env: @@ -192,6 +194,7 @@ jobs: - name: Install dependencies run: | bash -x .github/scripts/setup.sh + uv sync --all-extras --all-groups - name: Download build uses: actions/download-artifact@v4 @@ -241,7 +244,7 @@ jobs: - name: Install dependencies run: | bash -x .github/scripts/setup.sh - sudo apt-get update -qq + uv sync --all-extras --all-groups # We're going to check BOLT quotes, so get the latest version git clone https://github.com/lightning/bolts.git ../${BOLTDIR} @@ -275,6 +278,7 @@ jobs: - name: Install dependencies run: | bash -x .github/scripts/setup.sh + uv sync --all-extras --all-groups - name: Build run: | @@ -315,6 +319,7 @@ jobs: - name: Install dependencies run: | bash -x .github/scripts/setup.sh + uv sync --all-extras --all-groups - name: Install bitcoind env: @@ -434,6 +439,7 @@ jobs: - name: Install dependencies run: | bash -x .github/scripts/setup.sh + uv sync --all-extras --all-groups - name: Install bitcoind env: @@ -540,9 +546,8 @@ jobs: - name: Install dependencies run: | - sudo apt-get update -qq - sudo apt-get install -yyq valgrind bash -x .github/scripts/setup.sh + uv sync --all-extras --all-groups - name: Install bitcoind run: .github/scripts/install-bitcoind.sh @@ -635,6 +640,7 @@ jobs: - name: Install dependencies run: | bash -x .github/scripts/setup.sh + uv sync --all-extras --all-groups - name: Install bitcoind run: .github/scripts/install-bitcoind.sh @@ -686,6 +692,8 @@ jobs: - name: Install dependencies run: | bash -x .github/scripts/setup.sh + uv sync --all-extras --all-groups + - name: Install bitcoind env: TEST_NETWORK: regtest @@ -742,6 +750,7 @@ jobs: - name: Install dependencies run: | bash -x .github/scripts/setup.sh + uv sync --all-extras --all-groups - name: Download Bitcoin Core run: wget "https://bitcoincore.org/bin/bitcoin-core-${{ matrix.MIN_BTC_VERSION }}/bitcoin-${{ matrix.MIN_BTC_VERSION }}-x86_64-linux-gnu.tar.gz" From f24734c6a693cc6edc69ecdb3d8667511284403d Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 11 Feb 2026 16:11:27 +1030 Subject: [PATCH 05/10] CI: Don't explicitly invoke .github/scripts/install-bitcoind.sh It's done by setup.sh, so simply set the env var for that. Signed-off-by: Rusty Russell --- .github/workflows/ci.yaml | 42 ++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 7f76ecf5bb25..75f8744a13e2 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -85,6 +85,8 @@ jobs: uses: astral-sh/setup-uv@v5 - name: Install dependencies + env: + TEST_NETWORK: ${{ matrix.TEST_NETWORK }} run: | bash -x .github/scripts/setup.sh uv sync --all-extras --all-groups @@ -145,6 +147,8 @@ jobs: uses: astral-sh/setup-uv@v5 - name: Install dependencies + env: + TEST_NETWORK: ${{ matrix.TEST_NETWORK }} run: | bash -x .github/scripts/setup.sh uv sync --all-extras --all-groups @@ -192,6 +196,8 @@ jobs: uses: astral-sh/setup-uv@v5 - name: Install dependencies + env: + TEST_NETWORK: ${{ matrix.TEST_NETWORK }} run: | bash -x .github/scripts/setup.sh uv sync --all-extras --all-groups @@ -242,6 +248,8 @@ jobs: uses: astral-sh/setup-uv@v5 - name: Install dependencies + env: + TEST_NETWORK: ${{ matrix.TEST_NETWORK }} run: | bash -x .github/scripts/setup.sh uv sync --all-extras --all-groups @@ -276,6 +284,8 @@ jobs: uses: astral-sh/setup-uv@v5 - name: Install dependencies + env: + TEST_NETWORK: ${{ matrix.TEST_NETWORK }} run: | bash -x .github/scripts/setup.sh uv sync --all-extras --all-groups @@ -317,15 +327,12 @@ jobs: uses: astral-sh/setup-uv@v5 - name: Install dependencies + env: + TEST_NETWORK: ${{ matrix.TEST_NETWORK }} run: | bash -x .github/scripts/setup.sh uv sync --all-extras --all-groups - - name: Install bitcoind - env: - TEST_NETWORK: ${{ matrix.TEST_NETWORK }} - run: .github/scripts/install-bitcoind.sh - - name: Download build uses: actions/download-artifact@v4 with: @@ -437,15 +444,12 @@ jobs: uses: astral-sh/setup-uv@v5 - name: Install dependencies + env: + TEST_NETWORK: ${{ matrix.TEST_NETWORK }} run: | bash -x .github/scripts/setup.sh uv sync --all-extras --all-groups - - name: Install bitcoind - env: - TEST_NETWORK: ${{ matrix.TEST_NETWORK }} - run: .github/scripts/install-bitcoind.sh - - name: Download build uses: actions/download-artifact@v4 with: @@ -545,13 +549,12 @@ jobs: uses: astral-sh/setup-uv@v5 - name: Install dependencies + env: + TEST_NETWORK: ${{ matrix.TEST_NETWORK }} run: | bash -x .github/scripts/setup.sh uv sync --all-extras --all-groups - - name: Install bitcoind - run: .github/scripts/install-bitcoind.sh - - name: Download build uses: actions/download-artifact@v4 with: @@ -638,13 +641,12 @@ jobs: uses: astral-sh/setup-uv@v5 - name: Install dependencies + env: + TEST_NETWORK: ${{ matrix.TEST_NETWORK }} run: | bash -x .github/scripts/setup.sh uv sync --all-extras --all-groups - - name: Install bitcoind - run: .github/scripts/install-bitcoind.sh - - name: Download build uses: actions/download-artifact@v4 with: @@ -690,14 +692,12 @@ jobs: uses: astral-sh/setup-uv@v5 - name: Install dependencies + env: + TEST_NETWORK: ${{ matrix.TEST_NETWORK }} run: | bash -x .github/scripts/setup.sh uv sync --all-extras --all-groups - - name: Install bitcoind - env: - TEST_NETWORK: regtest - run: .github/scripts/install-bitcoind.sh - name: Download build uses: actions/download-artifact@v4 with: @@ -748,6 +748,8 @@ jobs: uses: astral-sh/setup-uv@v5 - name: Install dependencies + env: + TEST_NETWORK: ${{ matrix.TEST_NETWORK }} run: | bash -x .github/scripts/setup.sh uv sync --all-extras --all-groups From 6d22dcbec05042ea758fece6fa1cee5d5ded97d7 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 12 Feb 2026 10:39:35 +1030 Subject: [PATCH 06/10] CI: Don't do release target build. Before: 5m32 After: Signed-off-by: Rusty Russell --- .github/workflows/ci.yaml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 75f8744a13e2..abe2494cf8ec 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -11,9 +11,6 @@ concurrency: cancel-in-progress: true env: - # Makes the upload-artifact work more reliably at the cost - # of a bit of compile time. - RUST_PROFILE: release SLOW_MACHINE: 1 CI_SERVER_URL: "http://35.239.136.52:3170" PYTEST_OPTS_BASE: "-vvv --junit-xml=report.xml --timeout=1800 --durations=10" @@ -385,7 +382,6 @@ jobs: runs-on: *prefer-self-hosted timeout-minutes: 120 env: - RUST_PROFILE: release # Has to match the one in the compile step PYTEST_OPTS: -vvv --junit-xml=report.xml --timeout=1800 --durations=10 needs: - compile @@ -497,7 +493,6 @@ jobs: runs-on: *prefer-self-hosted timeout-minutes: 120 env: - RUST_PROFILE: release # Has to match the one in the compile step CFG: compile-gcc PYTEST_OPTS: -vvv --junit-xml=report.xml --timeout=1800 --durations=10 --test-group-random-seed=42 needs: @@ -582,7 +577,6 @@ jobs: runs-on: *prefer-self-hosted timeout-minutes: 120 env: - RUST_PROFILE: release SLOW_MACHINE: 1 TEST_DEBUG: 1 PYTEST_OPTS: -vvv --junit-xml=report.xml --timeout=1800 --durations=10 --test-group-random-seed=42 @@ -721,7 +715,6 @@ jobs: runs-on: *prefer-self-hosted timeout-minutes: 120 env: - RUST_PROFILE: release # Has to match the one in the compile step PYTEST_OPTS: -vvv --junit-xml=report.xml --timeout=1800 --durations=10 needs: - compile From 9db3cf8da816172cc549d539fb1cf59799d158f6 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 12 Feb 2026 10:40:35 +1030 Subject: [PATCH 07/10] CI: do cargo test --all as part of post-build step No point spending 1m24 seconds for *each* different compiler variant. Signed-off-by: Rusty Russell --- .github/workflows/ci.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index abe2494cf8ec..b8abe3cadc9d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -166,8 +166,6 @@ jobs: # Rename now so we don't clash mv testpack.tar.bz2 cln-${CFG}.tar.bz2 - - name: Check rust packages - run: cargo test --all - uses: actions/upload-artifact@v4 with: name: cln-${{ matrix.CFG }}.tar.bz2 @@ -213,6 +211,8 @@ jobs: - name: Check run: | uv run eatmydata make -j $(nproc) check-source-bolt check-python check-gen-updated check-doc + - name: Check rust packages + run: cargo test --all check-units: # The unit test checks are not in the critical path (not dependent From ff7921fa1b3245c4ce58a43022d45a21957f6c30 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 12 Feb 2026 10:41:35 +1030 Subject: [PATCH 08/10] CI: simply refresh boltdir if it already exists. Self-hosted runners may have this already. Signed-off-by: Rusty Russell --- .github/workflows/ci.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b8abe3cadc9d..f4ef850af640 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -87,8 +87,8 @@ jobs: run: | bash -x .github/scripts/setup.sh uv sync --all-extras --all-groups - # We're going to check BOLT quotes, so get the latest version - git clone https://github.com/lightning/bolts.git ../${BOLTDIR} + # We're going to check BOLT quotes, so get the latest version (or refresh) + git clone https://github.com/lightning/bolts.git ../${BOLTDIR} || git -C ../${BOLTDIR} pull - name: Configure run: ./configure --enable-debugbuild --enable-rust - name: Check source @@ -250,8 +250,8 @@ jobs: run: | bash -x .github/scripts/setup.sh uv sync --all-extras --all-groups - # We're going to check BOLT quotes, so get the latest version - git clone https://github.com/lightning/bolts.git ../${BOLTDIR} + # We're going to check BOLT quotes, so get the latest version (or refresh) + git clone https://github.com/lightning/bolts.git ../${BOLTDIR} || git -C ../${BOLTDIR} pull - name: Download build uses: actions/download-artifact@v4 From 492a31d5d2a0506809bedd3f66b6bc8cfedb36ee Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 12 Feb 2026 11:34:25 +1030 Subject: [PATCH 09/10] CI: use local paths if available for self-hosted runners. Don't upload/download if we're not on GitHub. This behavior is flagged by the existence of a /var/lib/github-runner/cache dir. Make sure you enable regular cleaning of this cache! Signed-off-by: Rusty Russell --- .github/workflows/action.yml | 31 +++++++++++++++++++++++++++++++ .github/workflows/ci.yaml | 30 ++++++++++++++++++++++-------- 2 files changed, 53 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/action.yml diff --git a/.github/workflows/action.yml b/.github/workflows/action.yml new file mode 100644 index 000000000000..2d9ad4c30fb4 --- /dev/null +++ b/.github/workflows/action.yml @@ -0,0 +1,31 @@ +name: Fetch artifact (local or GH) +description: Fetch artifact from local cache if available, otherwise download + +inputs: + name: + required: true + path: + required: false + default: . + +runs: + using: "composite" + steps: + - shell: bash + run: | + CACHE_BASE="${CACHE_BASE:-/var/lib/github-runner/cache}" + CACHE_DIR="$CACHE_BASE/${{ github.run_id }}" + + if [ -d "$CACHE_DIR" ] && [ -f "$CACHE_DIR/${{ inputs.name }}" ]; then + echo "Using local cached artifact" + cp "$CACHE_DIR/${{ inputs.name }}" "${{ inputs.path }}/" + else + echo "Falling back to GitHub artifact" + echo "DOWNLOAD_FROM_GH=1" >> "$GITHUB_ENV" + fi + + - uses: actions/download-artifact@v4 + if: env.DOWNLOAD_FROM_GH == '1' + with: + name: ${{ inputs.name }} + path: ${{ inputs.path }} diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f4ef850af640..8181dd10f391 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -166,7 +166,21 @@ jobs: # Rename now so we don't clash mv testpack.tar.bz2 cln-${CFG}.tar.bz2 + - name: Save build locally if cache dir exists + run: | + CACHE_BASE="/var/lib/github-runner/cache/" + if [ -d "$CACHE_BASE" ]; then + CACHE_DIR="$CACHE_BASE/${{ github.run_id }}" + echo "Using local cache directory" + mkdir -p "$CACHE_DIR" + cp cln-${{ matrix.CFG }}.tar.bz2 "$CACHE_DIR/" + echo "LOCAL_ARTIFACT=1" >> "$GITHUB_ENV" + else + echo "No local cache directory found" + echo "LOCAL_ARTIFACT=0" >> "$GITHUB_ENV" + fi - uses: actions/upload-artifact@v4 + if: env.LOCAL_ARTIFACT != '1' with: name: cln-${{ matrix.CFG }}.tar.bz2 path: cln-${{ matrix.CFG }}.tar.bz2 @@ -198,7 +212,7 @@ jobs: uv sync --all-extras --all-groups - name: Download build - uses: actions/download-artifact@v4 + uses: ./.github/actions/fetch-artifact with: name: cln-compile-gcc.tar.bz2 @@ -254,7 +268,7 @@ jobs: git clone https://github.com/lightning/bolts.git ../${BOLTDIR} || git -C ../${BOLTDIR} pull - name: Download build - uses: actions/download-artifact@v4 + uses: ./.github/actions/fetch-artifact with: name: cln-${{ matrix.CFG }}.tar.bz2 @@ -331,7 +345,7 @@ jobs: uv sync --all-extras --all-groups - name: Download build - uses: actions/download-artifact@v4 + uses: ./.github/actions/fetch-artifact with: name: cln-${{ matrix.CFG }}.tar.bz2 @@ -447,7 +461,7 @@ jobs: uv sync --all-extras --all-groups - name: Download build - uses: actions/download-artifact@v4 + uses: ./.github/actions/fetch-artifact with: name: cln-${{ matrix.CFG }}.tar.bz2 @@ -551,7 +565,7 @@ jobs: uv sync --all-extras --all-groups - name: Download build - uses: actions/download-artifact@v4 + uses: ./.github/actions/fetch-artifact with: name: cln-compile-gcc.tar.bz2 @@ -642,7 +656,7 @@ jobs: uv sync --all-extras --all-groups - name: Download build - uses: actions/download-artifact@v4 + uses: ./.github/actions/fetch-artifact with: name: cln-compile-clang-sanitizers.tar.bz2 @@ -693,7 +707,7 @@ jobs: uv sync --all-extras --all-groups - name: Download build - uses: actions/download-artifact@v4 + uses: ./.github/actions/fetch-artifact with: name: cln-compile-gcc.tar.bz2 - name: Unpack pre-built CLN @@ -760,7 +774,7 @@ jobs: run: rm -rf "bitcoin-${{ matrix.MIN_BTC_VERSION }}-x86_64-linux-gnu.tar.gz" "bitcoin-${{ matrix.MIN_BTC_VERSION }}" - name: Download build - uses: actions/download-artifact@v4 + uses: ./.github/actions/fetch-artifact with: name: cln-${{ matrix.CFG }}.tar.bz2 From 7d69b83f306eae35d69c09c92b6551e9480d6ccb Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 12 Feb 2026 11:34:33 +1030 Subject: [PATCH 10/10] CI: disable macos while we're testing --- .github/workflows/macos.yaml | 73 ------------------------------------ 1 file changed, 73 deletions(-) delete mode 100644 .github/workflows/macos.yaml diff --git a/.github/workflows/macos.yaml b/.github/workflows/macos.yaml deleted file mode 100644 index 71ca8e9d235f..000000000000 --- a/.github/workflows/macos.yaml +++ /dev/null @@ -1,73 +0,0 @@ ---- -name: Mac OS pytest -on: - pull_request: -jobs: - smoke-test: - name: Smoke Test macOS - runs-on: macos-14 - timeout-minutes: 120 - strategy: - fail-fast: true - matrix: - bitcoind-version: ["27.1"] - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Download Bitcoin ${{ matrix.bitcoind-version }} & install binaries - run: | - export BITCOIND_VERSION=${{ matrix.bitcoind-version }} - export TARGET_ARCH="arm64-apple-darwin" - - wget https://bitcoincore.org/bin/bitcoin-core-${BITCOIND_VERSION}/bitcoin-${BITCOIND_VERSION}-${TARGET_ARCH}.tar.gz - tar -xzf bitcoin-${BITCOIND_VERSION}-${TARGET_ARCH}.tar.gz - sudo mv bitcoin-${BITCOIND_VERSION}/bin/* /usr/local/bin - rm -rf bitcoin-${BITCOIND_VERSION}-${TARGET_ARCH}.tar.gz bitcoin-${BITCOIND_VERSION} - - - name: Set up Python 3.10 - uses: actions/setup-python@v5 - with: - python-version: "3.10" - - - name: Install uv - uses: astral-sh/setup-uv@v5 - - - name: Install dependencies - run: | - export PATH="/usr/local/opt:/Users/runner/.local/bin:/opt/homebrew/bin/python3.10/bin:$PATH" - - brew install gnu-sed autoconf automake libtool protobuf openssl lowdown libsodium - - # https://github.com/grpc/grpc/issues/31737#issuecomment-1323796842 - export GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=1 - export GRPC_PYTHON_BUILD_SYSTEM_ZLIB=1 - uv sync --all-groups - - - name: Build and install CLN - run: | - export CPATH=/opt/homebrew/include - export LIBRARY_PATH=/opt/homebrew/lib - - uv run ./configure --disable-valgrind --disable-compat - uv run make - - - name: Start bitcoind in regtest mode - run: | - bitcoind -regtest -daemon - sleep 5 - - - name: Generate initial block - run: | - bitcoin-cli -regtest createwallet default_wallet - bitcoin-cli -regtest generatetoaddress 1 $(bitcoin-cli -regtest getnewaddress) - sleep 2 - - - name: Start CLN in regtest mode - run: | - lightningd/lightningd --network=regtest --log-file=/tmp/l1.log --daemon - sleep 5 - - - name: Verify CLN is running - run: | - cli/lightning-cli --regtest getinfo