mirror of
https://github.com/ElementsProject/lightning.git
synced 2026-08-13 12:32:55 +02:00
Also trigger a db upgrade in the v26.09 so that impressions can be removed by the downgrade tool. Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
1033 lines
32 KiB
YAML
1033 lines
32 KiB
YAML
---
|
|
name: Continuous Integration
|
|
on:
|
|
push:
|
|
branches:
|
|
- "master"
|
|
pull_request:
|
|
types: [opened, synchronize, edited]
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
env:
|
|
# Reduce size, helps upload-artifact work more reliably
|
|
RUST_PROFILE: small
|
|
SLOW_MACHINE: 1
|
|
# This is for the pytest-trackflaky:
|
|
# CI_SERVER_URL: "http://35.239.136.52:3170"
|
|
PYTEST_OPTS_BASE: "-vvv --junit-xml=report.xml --timeout=1800 --durations=10"
|
|
TEST_LOG_IGNORE_ERRORS: "1"
|
|
SCCACHE_GHA_ENABLED: "true"
|
|
|
|
jobs:
|
|
prebuild:
|
|
name: Pre-build checks
|
|
runs-on: ubuntu-24.04
|
|
timeout-minutes: 120
|
|
if: |
|
|
github.event.action != 'edited' ||
|
|
contains(github.event.pull_request.body, 'Changelog')
|
|
env:
|
|
BOLTDIR: bolts
|
|
strategy:
|
|
fail-fast: true
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
with:
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
|
fetch-depth: 0
|
|
|
|
- name: Rebase
|
|
# We can't rebase if we're on master already.
|
|
if: github.ref != 'refs/heads/master'
|
|
run: |
|
|
git config user.name github-actions
|
|
git config user.email github-actions@github.com
|
|
git fetch origin ${{ github.base_ref }}
|
|
git rebase origin/${{ github.base_ref }}
|
|
|
|
- name: Check changelog
|
|
env:
|
|
PR_DESCRIPTION: "${{ github.event.pull_request.body || '' }}"
|
|
EVENT_NAME: "${{ github.event_name }}"
|
|
BASE_REF: "${{ github.base_ref || 'master' }}"
|
|
run: |
|
|
echo "Event Name: $EVENT_NAME"
|
|
echo "Base Ref: $BASE_REF"
|
|
echo "PR DESCRIPTION: $PR_DESCRIPTION"
|
|
if [ "$EVENT_NAME" = "pull_request" ]; then
|
|
if [[ "$PR_DESCRIPTION" != *"Changelog-None"* && \
|
|
-z "$(git log origin/$BASE_REF..HEAD --oneline --grep='Changelog-')" && \
|
|
"$(git rev-parse --abbrev-ref HEAD)" != "$BASE_REF" ]]; then
|
|
echo "::error::'Changelog' entry is missing in all commits, and 'Changelog-None' not specified in the PR description"
|
|
exit 1
|
|
else
|
|
if [[ "$PR_DESCRIPTION" == *"Changelog-None"* ]]; then
|
|
echo "Changelog found in PR description"
|
|
else
|
|
echo "Changelog found in Commit \"$(git log origin/$BASE_REF..HEAD --oneline --grep='Changelog-')\""
|
|
fi
|
|
fi
|
|
else
|
|
echo "Not a PR event."
|
|
fi
|
|
|
|
- name: Set up Python 3.10
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: "3.10"
|
|
|
|
- name: Install uv
|
|
uses: astral-sh/setup-uv@v8.1.0
|
|
|
|
- uses: actions/cache@v5
|
|
with:
|
|
path: ~/ci-cache
|
|
key: apt-${{ runner.os }}
|
|
|
|
- name: Install dependencies
|
|
env:
|
|
TEST_NETWORK: ${{ matrix.TEST_NETWORK }}
|
|
run: |
|
|
bash -x .github/scripts/setup.sh
|
|
# We're going to check BOLT quotes, so get the latest version
|
|
git clone https://github.com/lightning/bolts.git ../${BOLTDIR}
|
|
- name: Configure
|
|
run: ./configure --enable-debugbuild --enable-rust
|
|
- name: Check source
|
|
env:
|
|
VALGRIND: 0
|
|
PYTEST_OPTS: ${{ env.PYTEST_OPTS_BASE }}
|
|
run: |
|
|
uv run make -j $(nproc) check-source BASE_REF="origin/${{ github.base_ref }}" CARGO=false CC=devtools/cc-nobuild SUPPRESS_GENERATION=1
|
|
- name: Upload test results
|
|
if: always()
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: pytest-results-prebuild
|
|
path: report.xml
|
|
if-no-files-found: ignore
|
|
|
|
compile:
|
|
name: Build ${{ matrix.cfg }}
|
|
runs-on: ubuntu-24.04
|
|
timeout-minutes: 30
|
|
needs:
|
|
- prebuild
|
|
strategy:
|
|
fail-fast: true
|
|
matrix:
|
|
include:
|
|
- CFG: compile-gcc
|
|
VALGRIND: 1
|
|
COMPILER: gcc
|
|
DEBUG_BUILD: --enable-debugbuild
|
|
- CFG: compile-gcc-O1
|
|
VALGRIND: 1
|
|
COMPILER: gcc
|
|
COPTFLAGS_VAR: COPTFLAGS="-O1"
|
|
DEBUG_BUILD: --enable-debugbuild
|
|
- CFG: compile-gcc-O3
|
|
VALGRIND: 1
|
|
COMPILER: gcc
|
|
COPTFLAGS_VAR: COPTFLAGS="-O3 -Werror"
|
|
DEBUG_BUILD:
|
|
# While we're at it let's try to compile with clang
|
|
- CFG: compile-clang
|
|
VALGRIND: 1
|
|
COMPILER: clang
|
|
COPTFLAGS_VAR: COPTFLAGS="-O3"
|
|
DEBUG_BUILD: --enable-debugbuild
|
|
- CFG: compile-clang-sanitizers
|
|
COMPILER: clang
|
|
ASAN: 1
|
|
UBSAN: 1
|
|
VALGRIND: 0
|
|
COPTFLAGS_VAR: COPTFLAGS="-O1"
|
|
DEBUG_BUILD:
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Set up Python 3.10
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: "3.10"
|
|
|
|
- name: Install uv
|
|
uses: astral-sh/setup-uv@v8.1.0
|
|
|
|
- uses: actions/cache@v5
|
|
with:
|
|
path: ~/ci-cache
|
|
key: apt-${{ runner.os }}
|
|
|
|
- name: Install dependencies
|
|
env:
|
|
TEST_NETWORK: ${{ matrix.TEST_NETWORK }}
|
|
run: |
|
|
bash -x .github/scripts/setup.sh
|
|
|
|
- name: Setup sccache
|
|
uses: mozilla-actions/sccache-action@v0.0.10
|
|
- run: sccache --zero-stats
|
|
|
|
- name: Build
|
|
env:
|
|
COMPILER: ${{ matrix.COMPILER }}
|
|
ASAN: ${{ matrix.ASAN }}
|
|
UBSAN: ${{ matrix.UBSAN }}
|
|
VALGRIND: ${{ matrix.VALGRIND }}
|
|
COMPAT: 1
|
|
RUSTC_WRAPPER: sccache
|
|
run: |
|
|
set -e
|
|
./configure ${{ matrix.DEBUG_BUILD }} CC="sccache $COMPILER" ${{ matrix.COPTFLAGS_VAR }}
|
|
|
|
uv run make -j $(nproc) testpack.tar.gz
|
|
|
|
# Rename now so we don't clash
|
|
mv testpack.tar.gz cln-${{ matrix.CFG }}.tar.gz
|
|
- uses: actions/upload-artifact@v7
|
|
with:
|
|
name: cln-${{ matrix.CFG }}.tar.gz
|
|
path: cln-${{ matrix.CFG }}.tar.gz
|
|
|
|
check-compiled-source:
|
|
runs-on: ubuntu-24.04
|
|
needs:
|
|
- compile
|
|
strategy:
|
|
matrix:
|
|
CFG: [compile-gcc]
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Set up Python 3.10
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: "3.10"
|
|
|
|
- name: Install uv
|
|
uses: astral-sh/setup-uv@v8.1.0
|
|
|
|
- uses: actions/cache@v5
|
|
with:
|
|
path: ~/ci-cache
|
|
key: apt-${{ runner.os }}
|
|
|
|
- name: Install dependencies
|
|
env:
|
|
TEST_NETWORK: ${{ matrix.TEST_NETWORK }}
|
|
run: |
|
|
bash -x .github/scripts/setup.sh
|
|
|
|
- name: Download build
|
|
uses: actions/download-artifact@v8
|
|
with:
|
|
name: cln-${{ matrix.CFG }}.tar.gz
|
|
|
|
- name: Unpack prebuilt binaries
|
|
run: |
|
|
git submodule sync && git submodule update --init --recursive
|
|
# Make sure source appears older than what we're about to unpack
|
|
find . -type f -print0 | xargs -0 touch -d yesterday
|
|
tar xaf cln-${{ matrix.CFG }}.tar.gz
|
|
|
|
- name: Setup sccache
|
|
uses: mozilla-actions/sccache-action@v0.0.10
|
|
- run: sccache --zero-stats
|
|
|
|
- name: Check
|
|
run: |
|
|
uv run eatmydata make -j $(nproc) check-source-bolt check-python check-gen-updated check-doc CARGO=false CC=devtools/cc-nobuild SUPPRESS_GENERATION=1
|
|
- name: Check rust packages
|
|
env:
|
|
RUSTC_WRAPPER: sccache
|
|
run: cargo test --all
|
|
|
|
check-units:
|
|
# 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
|
|
timeout-minutes: 60
|
|
env:
|
|
BOLTDIR: bolts
|
|
needs:
|
|
- compile
|
|
strategy:
|
|
fail-fast: true
|
|
matrix:
|
|
include:
|
|
- CFG: compile-gcc-O1
|
|
VALGRIND: 1
|
|
- CFG: compile-clang-sanitizers
|
|
VALGRIND: 0
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Set up Python 3.10
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: "3.10"
|
|
|
|
- name: Install uv
|
|
uses: astral-sh/setup-uv@v8.1.0
|
|
|
|
- uses: actions/cache@v5
|
|
with:
|
|
path: ~/ci-cache
|
|
key: apt-${{ runner.os }}
|
|
|
|
- name: Install dependencies
|
|
env:
|
|
TEST_NETWORK: ${{ matrix.TEST_NETWORK }}
|
|
run: |
|
|
bash -x .github/scripts/setup.sh
|
|
# We're going to check BOLT quotes, so get the latest version
|
|
git clone https://github.com/lightning/bolts.git ../${BOLTDIR}
|
|
|
|
- name: Download build
|
|
uses: actions/download-artifact@v8
|
|
with:
|
|
name: cln-${{ matrix.CFG }}.tar.gz
|
|
|
|
- name: Unpack prebuilt binaries
|
|
run: |
|
|
git submodule sync && git submodule update --init --recursive
|
|
# Make sure source appears older than what we're about to unpack
|
|
find . -type f -print0 | xargs -0 touch -d yesterday
|
|
tar xaf cln-${{ matrix.CFG }}.tar.gz
|
|
|
|
# external/Makefile uses `TARGET_DIR := external/build-$(shell ${CC} -dumpmachine)` so we need sccache to "work" for that.
|
|
- name: Setup sccache
|
|
uses: mozilla-actions/sccache-action@v0.0.10
|
|
|
|
- name: Check
|
|
run: |
|
|
uv run eatmydata make -j $(nproc) check-units installcheck VALGRIND=${{ matrix.VALGRIND }} CARGO=false CC=devtools/cc-nobuild SUPPRESS_GENERATION=1
|
|
|
|
compile-32bit:
|
|
name: Build 32-bit (size_t != 64-bit warnings)
|
|
runs-on: ubuntu-24.04
|
|
timeout-minutes: 30
|
|
needs:
|
|
- prebuild
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Add i386 architecture
|
|
run: |
|
|
sudo dpkg --add-architecture i386
|
|
sudo apt-get update -qq
|
|
|
|
- name: Install uv
|
|
uses: astral-sh/setup-uv@v8.1.0
|
|
|
|
- name: Install dependencies
|
|
env:
|
|
TEST_NETWORK: ${{ matrix.TEST_NETWORK }}
|
|
run: |
|
|
bash -x .github/scripts/setup.sh
|
|
sudo apt-get install --no-install-recommends -yy \
|
|
gcc-multilib \
|
|
libsodium-dev:i386 \
|
|
libsqlite3-dev:i386 \
|
|
zlib1g-dev:i386
|
|
|
|
- name: Build
|
|
env:
|
|
PKG_CONFIG_PATH: /usr/lib/i386-linux-gnu/pkgconfig
|
|
run: |
|
|
./configure --disable-rust --enable-debugbuild CC="gcc -m32"
|
|
uv run make -j $(nproc) all-programs
|
|
|
|
check-fuzz:
|
|
name: Run fuzz regression tests
|
|
runs-on: ubuntu-24.04
|
|
needs:
|
|
- prebuild
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Set up Python 3.10
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: "3.10"
|
|
|
|
- name: Install uv
|
|
uses: astral-sh/setup-uv@v8.1.0
|
|
|
|
- uses: actions/cache@v5
|
|
with:
|
|
path: ~/ci-cache
|
|
key: apt-${{ runner.os }}
|
|
|
|
- name: Install dependencies
|
|
env:
|
|
TEST_NETWORK: ${{ matrix.TEST_NETWORK }}
|
|
run: |
|
|
bash -x .github/scripts/setup.sh
|
|
|
|
- name: Setup sccache
|
|
uses: mozilla-actions/sccache-action@v0.0.10
|
|
- run: sccache --zero-stats
|
|
|
|
- name: Build
|
|
env:
|
|
RUSTC_WRAPPER: sccache
|
|
run: |
|
|
./configure --enable-debugbuild --enable-fuzzing --enable-address-sanitizer --enable-ub-sanitizer --disable-valgrind CC="sccache clang"
|
|
uv run make -j $(nproc) check-fuzz
|
|
|
|
check-downgrade:
|
|
name: Check we can downgrade the node
|
|
runs-on: ubuntu-24.04
|
|
needs:
|
|
- check-compiled-source
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- CFG: compile-gcc
|
|
TEST_DB_PROVIDER: sqlite3
|
|
TEST_NETWORK: regtest
|
|
VALGRIND: 1
|
|
- CFG: compile-gcc
|
|
TEST_DB_PROVIDER: postgres
|
|
TEST_NETWORK: regtest
|
|
- CFG: compile-gcc
|
|
TEST_DB_PROVIDER: sqlite3
|
|
TEST_NETWORK: liquid-regtest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Set up Python 3.10
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: "3.10"
|
|
|
|
- name: Install uv
|
|
uses: astral-sh/setup-uv@v8.1.0
|
|
|
|
- uses: actions/cache@v5
|
|
with:
|
|
path: ~/ci-cache
|
|
key: apt-${{ runner.os }}
|
|
|
|
- name: Install dependencies
|
|
env:
|
|
TEST_NETWORK: ${{ matrix.TEST_NETWORK }}
|
|
run: |
|
|
bash -x .github/scripts/setup.sh
|
|
|
|
- name: Download build
|
|
uses: actions/download-artifact@v8
|
|
with:
|
|
name: cln-${{ matrix.CFG }}.tar.gz
|
|
|
|
- name: Unpack prebuilt binaries
|
|
run: |
|
|
git submodule sync && git submodule update --init --recursive
|
|
# Make sure source appears older than what we're about to unpack
|
|
find . -type f -print0 | xargs -0 touch -d yesterday
|
|
tar xaf cln-${{ matrix.CFG }}.tar.gz
|
|
|
|
- name: Fetch and unpack previous CLN
|
|
run: |
|
|
mkdir old-cln
|
|
cd old-cln
|
|
wget https://github.com/ElementsProject/lightning/releases/download/v26.06/clightning-v26.06-ubuntu-24.04-amd64.tar.xz
|
|
tar -xaf clightning-v26.06-ubuntu-24.04-amd64.tar.xz
|
|
|
|
- name: Switch network
|
|
if: ${{ matrix.TEST_NETWORK == 'liquid-regtest' }}
|
|
run: |
|
|
# Loading the network from config.vars rather than the envvar is a terrible idea...
|
|
sed -i 's/TEST_NETWORK=regtest/TEST_NETWORK=liquid-regtest/g' config.vars
|
|
cat config.vars
|
|
touch -d yesterday config.vars
|
|
|
|
- name: Test
|
|
env:
|
|
SLOW_MACHINE: 1
|
|
TEST_DEBUG: 1
|
|
TEST_DB_PROVIDER: ${{ matrix.TEST_DB_PROVIDER }}
|
|
TEST_NETWORK: ${{ matrix.TEST_NETWORK }}
|
|
LIGHTNINGD_POSTGRES_NO_VACUUM: 1
|
|
VALGRIND: ${{ matrix.VALGRIND }}
|
|
PREV_LIGHTNINGD: old-cln/usr/bin/lightningd
|
|
CLN_PREV_VERSION: v26.06
|
|
PYTEST_OPTS: ${{ env.PYTEST_OPTS_BASE }}
|
|
run: |
|
|
env
|
|
cat config.vars
|
|
sg wireshark "uv run eatmydata pytest tests/test_downgrade.py -n $(($(nproc) + 1)) ${PYTEST_OPTS}"
|
|
- name: Upload test results
|
|
if: always()
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: pytest-results-check-downgrade-${{ matrix.TEST_DB_PROVIDER }}-${{ matrix.TEST_NETWORK }}
|
|
path: report.xml
|
|
if-no-files-found: ignore
|
|
|
|
# For speed, we run a first integration test using gcc and sqlite3, in 6 parts.
|
|
# If that passes, we move on to the more complete integration tests.
|
|
first-integration:
|
|
name: First Integration Tests (${{ matrix.GROUP }}/${{ matrix.GROUP_COUNT }})
|
|
runs-on: ubuntu-24.04
|
|
timeout-minutes: 120
|
|
env:
|
|
RUST_PROFILE: small # Has to match the one in the compile step
|
|
needs:
|
|
- compile
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
CFG: [compile-gcc]
|
|
GROUP: [1,2,3,4,5,6]
|
|
GROUP_COUNT: [6]
|
|
TEST_DB_PROVIDER: [sqlite3]
|
|
COMPILER: [gcc]
|
|
TEST_NETWORK: [regtest]
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Set up Python 3.10
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: "3.10"
|
|
|
|
- name: Install uv
|
|
uses: astral-sh/setup-uv@v8.1.0
|
|
|
|
- uses: actions/cache@v5
|
|
with:
|
|
path: ~/ci-cache
|
|
key: apt-${{ runner.os }}
|
|
|
|
- name: Install dependencies
|
|
env:
|
|
TEST_NETWORK: ${{ matrix.TEST_NETWORK }}
|
|
run: |
|
|
bash -x .github/scripts/setup.sh
|
|
|
|
- name: Download build
|
|
uses: actions/download-artifact@v8
|
|
with:
|
|
name: cln-${{ matrix.CFG }}.tar.gz
|
|
|
|
- name: Unpack prebuilt binaries
|
|
run: |
|
|
git submodule sync && git submodule update --init --recursive
|
|
# Make sure source appears older than what we're about to unpack
|
|
find . -type f -print0 | xargs -0 touch -d yesterday
|
|
tar xaf cln-${{ matrix.CFG }}.tar.gz
|
|
|
|
- name: Test
|
|
env:
|
|
COMPILER: ${{ matrix.COMPILER }}
|
|
EXPERIMENTAL_DUAL_FUND: ${{ matrix.EXPERIMENTAL_DUAL_FUND }}
|
|
COMPAT: 1
|
|
SLOW_MACHINE: 1
|
|
TEST_DEBUG: 1
|
|
TEST_DB_PROVIDER: ${{ matrix.TEST_DB_PROVIDER }}
|
|
TEST_NETWORK: ${{ matrix.TEST_NETWORK }}
|
|
LIGHTNINGD_POSTGRES_NO_VACUUM: 1
|
|
PYTEST_OPTS: ${{ env.PYTEST_OPTS_BASE }} --test-group-random-seed=42
|
|
run: |
|
|
env
|
|
cat config.vars
|
|
VALGRIND=0 sg wireshark "uv run eatmydata pytest tests/ -n $(($(nproc) + 1)) ${PYTEST_OPTS} --test-group=${{ matrix.GROUP }} --test-group-count=${{ matrix.GROUP_COUNT }}"
|
|
- name: Upload test results
|
|
if: always()
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: pytest-results-first-integration-${{ matrix.GROUP }}
|
|
path: report.xml
|
|
if-no-files-found: ignore
|
|
|
|
full-integration:
|
|
name: Test CLN ${{ matrix.name }} Full Integration
|
|
runs-on: ubuntu-24.04
|
|
timeout-minutes: 120
|
|
env:
|
|
RUST_PROFILE: small # Has to match the one in the compile step
|
|
needs:
|
|
- first-integration
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
# We do a clang run, but with minimum BTC version, to avoid YA test run.
|
|
# And of course we want to test postgres too
|
|
- NAME: postgres
|
|
CFG: compile-gcc-O3
|
|
COMPILER: gcc
|
|
TEST_DB_PROVIDER: postgres
|
|
TEST_NETWORK: regtest
|
|
# And don't forget about elements (like cdecker did when
|
|
# reworking the CI...)
|
|
- NAME: liquid
|
|
CFG: compile-gcc-O3
|
|
COMPILER: gcc
|
|
TEST_NETWORK: liquid-regtest
|
|
TEST_DB_PROVIDER: sqlite3
|
|
# And dual funding!
|
|
- NAME: dual-fund
|
|
CFG: compile-gcc
|
|
TEST_DB_PROVIDER: sqlite3
|
|
COMPILER: gcc
|
|
TEST_NETWORK: regtest
|
|
EXPERIMENTAL_DUAL_FUND: 1
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Set up Python 3.10
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: "3.10"
|
|
|
|
- name: Install uv
|
|
uses: astral-sh/setup-uv@v8.1.0
|
|
|
|
- uses: actions/cache@v5
|
|
with:
|
|
path: ~/ci-cache
|
|
key: apt-${{ runner.os }}
|
|
|
|
- name: Install dependencies
|
|
env:
|
|
TEST_NETWORK: ${{ matrix.TEST_NETWORK }}
|
|
run: |
|
|
bash -x .github/scripts/setup.sh
|
|
|
|
- name: Download build
|
|
uses: actions/download-artifact@v8
|
|
with:
|
|
name: cln-${{ matrix.CFG }}.tar.gz
|
|
|
|
- name: Unpack prebuilt binaries
|
|
run: |
|
|
git submodule sync && git submodule update --init --recursive
|
|
# Make sure source appears older than what we're about to unpack
|
|
find . -type f -print0 | xargs -0 touch -d yesterday
|
|
tar xaf cln-${{ matrix.CFG }}.tar.gz
|
|
|
|
- name: Switch network
|
|
if: ${{ matrix.TEST_NETWORK == 'liquid-regtest' }}
|
|
run: |
|
|
# Loading the network from config.vars rather than the envvar is a terrible idea...
|
|
sed -i 's/TEST_NETWORK=regtest/TEST_NETWORK=liquid-regtest/g' config.vars
|
|
cat config.vars
|
|
|
|
- name: Test
|
|
env:
|
|
COMPILER: ${{ matrix.COMPILER }}
|
|
EXPERIMENTAL_DUAL_FUND: ${{ matrix.EXPERIMENTAL_DUAL_FUND }}
|
|
COMPAT: 1
|
|
SLOW_MACHINE: 1
|
|
TEST_DEBUG: 1
|
|
TEST_DB_PROVIDER: ${{ matrix.TEST_DB_PROVIDER }}
|
|
TEST_NETWORK: ${{ matrix.TEST_NETWORK }}
|
|
LIGHTNINGD_POSTGRES_NO_VACUUM: 1
|
|
PYTEST_OPTS: ${{ env.PYTEST_OPTS_BASE }}
|
|
run: |
|
|
env
|
|
cat config.vars
|
|
VALGRIND=0 sg wireshark "uv run eatmydata pytest tests/ -n $(($(nproc) + 1)) ${PYTEST_OPTS}"
|
|
- name: Upload test results
|
|
if: always()
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: pytest-results-integration-${{ matrix.name }}
|
|
path: report.xml
|
|
if-no-files-found: ignore
|
|
|
|
integration-valgrind:
|
|
name: Valgrind Test CLN (${{ matrix.GROUP }}/${{ matrix.GROUP_COUNT }})
|
|
runs-on: ubuntu-24.04
|
|
timeout-minutes: 120
|
|
env:
|
|
RUST_PROFILE: small # Has to match the one in the compile step
|
|
needs:
|
|
- check-compiled-source
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
CFG: [compile-gcc-O1]
|
|
GROUP: [1,2,3,4,5,6,7,8,9,10,11,12]
|
|
GROUP_COUNT: [12]
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Set up Python 3.10
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: "3.10"
|
|
|
|
- name: Install uv
|
|
uses: astral-sh/setup-uv@v8.1.0
|
|
|
|
- uses: actions/cache@v5
|
|
with:
|
|
path: ~/ci-cache
|
|
key: apt-${{ runner.os }}
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
bash -x .github/scripts/setup.sh
|
|
|
|
- name: Download build
|
|
uses: actions/download-artifact@v8
|
|
with:
|
|
name: cln-${{ matrix.CFG }}.tar.gz
|
|
|
|
- name: Unpack prebuilt binaries
|
|
run: |
|
|
git submodule sync && git submodule update --init --recursive
|
|
# Make sure source appears older than what we're about to unpack
|
|
find . -type f -print0 | xargs -0 touch -d yesterday
|
|
tar xaf cln-${{ matrix.CFG }}.tar.gz
|
|
|
|
- name: Test
|
|
env:
|
|
SLOW_MACHINE: 1
|
|
TEST_DEBUG: 1
|
|
PYTEST_OPTS: ${{ env.PYTEST_OPTS_BASE }} --test-group-random-seed=42
|
|
run: |
|
|
# -n $(nproc) rather than $(nproc)+1: one fewer parallel node-cluster
|
|
# keeps peak RSS under the 16GB hosted-runner ceiling.
|
|
VALGRIND=1 sg wireshark "uv run eatmydata pytest tests/ -n $(nproc) ${PYTEST_OPTS} --test-group=${{ matrix.GROUP }} --test-group-count=${{ matrix.GROUP_COUNT }}"
|
|
- name: Report OOM kills
|
|
if: failure()
|
|
run: |
|
|
echo "=== dmesg (OOM) ==="; sudo dmesg | grep -i -E 'oom|out of memory|killed process' || echo "no OOM lines in dmesg"
|
|
echo "=== kernel log ==="; sudo journalctl -k --no-pager | tail -n 50 || true
|
|
- name: Upload test results
|
|
if: always()
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: pytest-results-integration-valgrind-${{ matrix.GROUP }}
|
|
path: report.xml
|
|
if-no-files-found: ignore
|
|
|
|
integration-sanitizers:
|
|
name: ASan/UBSan (${{ matrix.GROUP }}/${{ matrix.GROUP_COUNT }})
|
|
runs-on: ubuntu-24.04
|
|
timeout-minutes: 120
|
|
env:
|
|
RUST_PROFILE: small
|
|
SLOW_MACHINE: 1
|
|
TEST_DEBUG: 1
|
|
needs:
|
|
- check-compiled-source
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
CFG: [compile-clang-sanitizers]
|
|
GROUP: [1,2,3,4,5,6]
|
|
GROUP_COUNT: [6]
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Set up Python 3.10
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: "3.10"
|
|
|
|
- name: Install uv
|
|
uses: astral-sh/setup-uv@v8.1.0
|
|
|
|
- uses: actions/cache@v5
|
|
with:
|
|
path: ~/ci-cache
|
|
key: apt-${{ runner.os }}
|
|
|
|
- name: Install dependencies
|
|
env:
|
|
TEST_NETWORK: ${{ matrix.TEST_NETWORK }}
|
|
run: |
|
|
bash -x .github/scripts/setup.sh
|
|
|
|
- name: Download build
|
|
uses: actions/download-artifact@v8
|
|
with:
|
|
name: cln-${{ matrix.CFG }}.tar.gz
|
|
|
|
- name: Unpack prebuilt binaries
|
|
run: |
|
|
git submodule sync && git submodule update --init --recursive
|
|
# Make sure source appears older than what we're about to unpack
|
|
find . -type f -print0 | xargs -0 touch -d yesterday
|
|
tar xaf cln-${{ matrix.CFG }}.tar.gz
|
|
|
|
- name: Test
|
|
env:
|
|
PYTEST_OPTS: ${{ env.PYTEST_OPTS_BASE }} --test-group-random-seed=42
|
|
run: |
|
|
# -n $(nproc) rather than $(nproc)+1: one fewer parallel node-cluster
|
|
# keeps ASan peak RSS under the 16GB hosted-runner ceiling.
|
|
sg wireshark "uv run eatmydata pytest tests/ -n $(nproc) ${PYTEST_OPTS} --test-group=${{ matrix.GROUP }} --test-group-count=${{ matrix.GROUP_COUNT }}"
|
|
- name: Report OOM kills
|
|
if: failure()
|
|
run: |
|
|
echo "=== dmesg (OOM) ==="; sudo dmesg | grep -i -E 'oom|out of memory|killed process' || echo "no OOM lines in dmesg"
|
|
echo "=== kernel log ==="; sudo journalctl -k --no-pager | tail -n 50 || true
|
|
- name: Upload test results
|
|
if: always()
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: pytest-results-integration-sanitizers-${{ matrix.GROUP }}
|
|
path: report.xml
|
|
if-no-files-found: ignore
|
|
|
|
update-docs-examples:
|
|
name: Update examples in doc schemas
|
|
runs-on: ubuntu-24.04
|
|
timeout-minutes: 30
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
CFG: [compile-gcc]
|
|
env:
|
|
VALGRIND: 0
|
|
GENERATE_EXAMPLES: 1
|
|
TEST_NETWORK: regtest
|
|
needs:
|
|
- compile
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
- name: Set up Python 3.10
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: "3.10"
|
|
|
|
- name: Install uv
|
|
uses: astral-sh/setup-uv@v8.1.0
|
|
|
|
- uses: actions/cache@v5
|
|
with:
|
|
path: ~/ci-cache
|
|
key: apt-${{ runner.os }}
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
bash -x .github/scripts/setup.sh
|
|
|
|
- name: Download build
|
|
uses: actions/download-artifact@v8
|
|
with:
|
|
name: cln-${{ matrix.CFG }}.tar.gz
|
|
- name: Unpack prebuilt binaries
|
|
run: |
|
|
git submodule sync && git submodule update --init --recursive
|
|
# Make sure source appears older than what we're about to unpack
|
|
find . -type f -print0 | xargs -0 touch -d yesterday
|
|
tar xaf cln-${{ matrix.CFG }}.tar.gz
|
|
|
|
- name: Debug check-doc-examples inputs
|
|
run: |
|
|
echo "== lightning-hsmtool =="
|
|
which lightning-hsmtool || echo "NOT ON PATH"
|
|
find . -name "lightning-hsmtool*" -not -path "./.git/*" 2>/dev/null
|
|
|
|
echo "== autogenerate-bitcoind-wallet.dat =="
|
|
ls -la tests/data/autogenerate-bitcoind-wallet.dat 2>&1
|
|
|
|
echo "== autogenerate-bitcoin-blocks.json =="
|
|
ls -la tests/data/autogenerate-bitcoin-blocks.json 2>&1
|
|
echo "-- number of blocks --"
|
|
python3 -c "import json; print(len(json.load(open('tests/data/autogenerate-bitcoin-blocks.json'))))" 2>&1
|
|
echo "-- first 300 chars --"
|
|
head -c 300 tests/data/autogenerate-bitcoin-blocks.json
|
|
echo ""
|
|
|
|
echo "== environment fingerprint =="
|
|
# Determinism discriminators: HAVE_USDT toggles tracing, which
|
|
# must not perturb the deterministic RNG stream.
|
|
grep -E 'HAVE_USDT|HAVE_SQLITE3' config.vars || true
|
|
bitcoind --version | head -1 || true
|
|
dpkg -l systemtap-sdt-dev 2>/dev/null | tail -1 || true
|
|
|
|
- name: Test
|
|
env:
|
|
PYTEST_OPTS: ${{ env.PYTEST_OPTS_BASE }}
|
|
run: |
|
|
uv run eatmydata make -j $(($(nproc) + 1)) check-doc-examples CARGO=false CC=devtools/cc-nobuild SUPPRESS_GENERATION=1
|
|
- name: Save doc diff on failure
|
|
if: failure()
|
|
run: |
|
|
git diff -- doc > doc-examples.patch || true
|
|
git status --short -- doc
|
|
- name: Collect node logs on failure
|
|
if: failure()
|
|
run: |
|
|
mkdir -p ltests-debug
|
|
# pyln-testing leaves /tmp/ltests-* behind on failure: grab every
|
|
# node's daemon log and config (skip databases and sockets).
|
|
find /tmp/ltests-* -type f \( -name 'log' -o -name '*.log' -o -name 'config' \) \
|
|
-exec cp --parents -t ltests-debug {} + 2>/dev/null || true
|
|
- name: Upload debug artifacts
|
|
if: failure()
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: doc-examples-debug
|
|
path: |
|
|
doc-examples.patch
|
|
ltests-debug/
|
|
if-no-files-found: ignore
|
|
- name: Upload test results
|
|
if: always()
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: pytest-results-update-docs-examples
|
|
path: report.xml
|
|
if-no-files-found: ignore
|
|
|
|
min-btc-support:
|
|
name: Test minimum supported BTC v${{ matrix.MIN_BTC_VERSION }} with ${{ matrix.NAME }}
|
|
runs-on: ubuntu-24.04
|
|
timeout-minutes: 120
|
|
env:
|
|
RUST_PROFILE: small # Has to match the one in the compile step
|
|
needs:
|
|
- compile
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- NAME: clang
|
|
CFG: compile-clang
|
|
TEST_DB_PROVIDER: sqlite3
|
|
COMPILER: clang
|
|
TEST_NETWORK: regtest
|
|
MIN_BTC_VERSION: "25.0"
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Set up Python 3.10
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: "3.10"
|
|
|
|
- name: Install uv
|
|
uses: astral-sh/setup-uv@v8.1.0
|
|
|
|
- uses: actions/cache@v5
|
|
with:
|
|
path: ~/ci-cache
|
|
key: apt-${{ runner.os }}
|
|
|
|
- name: Install dependencies
|
|
env:
|
|
TEST_NETWORK: ${{ matrix.TEST_NETWORK }}
|
|
run: |
|
|
bash -x .github/scripts/setup.sh
|
|
|
|
- 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"
|
|
|
|
- name: Extract Bitcoin Core
|
|
run: tar -xf "bitcoin-${{ matrix.MIN_BTC_VERSION }}-x86_64-linux-gnu.tar.gz"
|
|
|
|
- name: Move Bitcoin Core Binaries
|
|
run: sudo mv bitcoin-${{ matrix.MIN_BTC_VERSION }}/bin/* /usr/local/bin/
|
|
|
|
- name: Clean Up Downloaded Bitcoin
|
|
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@v8
|
|
with:
|
|
name: cln-${{ matrix.CFG }}.tar.gz
|
|
|
|
- name: Unpack prebuilt binaries
|
|
run: |
|
|
git submodule sync && git submodule update --init --recursive
|
|
# Make sure source appears older than what we're about to unpack
|
|
find . -type f -print0 | xargs -0 touch -d yesterday
|
|
tar xaf cln-${{ matrix.CFG }}.tar.gz
|
|
|
|
- name: Test
|
|
env:
|
|
COMPILER: ${{ matrix.COMPILER }}
|
|
COMPAT: 1
|
|
SLOW_MACHINE: 1
|
|
TEST_DEBUG: 1
|
|
TEST_DB_PROVIDER: ${{ matrix.TEST_DB_PROVIDER }}
|
|
TEST_NETWORK: ${{ matrix.TEST_NETWORK }}
|
|
LIGHTNINGD_POSTGRES_NO_VACUUM: 1
|
|
PYTEST_OPTS: ${{ env.PYTEST_OPTS_BASE }}
|
|
run: |
|
|
env
|
|
cat config.vars
|
|
VALGRIND=0 sg wireshark "uv run eatmydata pytest tests/ -n $(($(nproc) + 1)) ${PYTEST_OPTS}"
|
|
- name: Upload test results
|
|
if: always()
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: pytest-results-min-btc-support-${{ matrix.NAME }}
|
|
path: report.xml
|
|
if-no-files-found: ignore
|
|
|
|
|
|
gather:
|
|
# A dummy task that depends on the full matrix of tests, and
|
|
# signals successful completion. Used for the PR status to pass
|
|
# before merging. Needs to run even if they failed!
|
|
name: CI completion
|
|
runs-on: ubuntu-24.04
|
|
needs:
|
|
- first-integration
|
|
- full-integration
|
|
- check-units
|
|
- integration-valgrind
|
|
- integration-sanitizers
|
|
- update-docs-examples
|
|
- min-btc-support
|
|
- check-downgrade
|
|
- check-compiled-source
|
|
- compile-32bit
|
|
if: ${{ always() }}
|
|
steps:
|
|
- name: Complete
|
|
env:
|
|
JOB_NAMES: "FIRST_INTEGRATION FULL_INTEGRATION CHECK_UNITS VALGRIND SANITIZERS BTC CHECK_COMPILED_SOURCE COMPILE_32BIT"
|
|
FIRST_INTEGRATION: ${{ needs['first-integration'].result }}
|
|
FULL_INTEGRATION: ${{ needs['full-integration'].result }}
|
|
CHECK_UNITS: ${{ needs['check-units'].result }}
|
|
VALGRIND: ${{ needs['integration-valgrind'].result }}
|
|
SANITIZERS: ${{ needs['integration-sanitizers'].result }}
|
|
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 }}
|
|
COMPILE_32BIT: ${{ needs['compile-32bit'].result }}
|
|
run: |
|
|
failed=""
|
|
for name in $JOB_NAMES; do
|
|
result="${!name}"
|
|
echo "$name: $result"
|
|
if [[ "$result" != "success" ]]; then
|
|
failed="yes"
|
|
fi
|
|
done
|
|
if [[ "$failed" == "yes" ]]; then
|
|
echo "One or more required jobs failed"
|
|
exit 1
|
|
fi
|