2021-01-09 16:23:06 +01:00
|
|
|
---
|
|
|
|
name: Continuous Integration
|
2022-02-24 14:56:09 +01:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- "master"
|
|
|
|
pull_request:
|
2022-12-16 15:56:21 +01:00
|
|
|
|
2022-12-16 12:12:07 +01:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
|
|
cancel-in-progress: true
|
2022-12-20 10:11:59 +01:00
|
|
|
|
|
|
|
env:
|
|
|
|
# Makes the upload-artifact work more reliably at the cost
|
|
|
|
# of a bit of compile time.
|
|
|
|
RUST_PROFILE: release
|
|
|
|
SLOW_MACHINE: 1
|
|
|
|
|
2021-01-09 16:23:06 +01:00
|
|
|
jobs:
|
2022-11-09 13:31:15 +01:00
|
|
|
prebuild:
|
|
|
|
name: Pre-build checks
|
2021-02-01 17:22:32 +01:00
|
|
|
runs-on: ubuntu-20.04
|
2021-01-13 11:21:57 +01:00
|
|
|
env:
|
2022-11-09 13:31:15 +01:00
|
|
|
RUST: 1
|
2021-01-13 11:21:57 +01:00
|
|
|
COMPAT: 1
|
2022-12-15 16:03:52 +01:00
|
|
|
BOLTDIR: bolts
|
2021-01-09 16:23:06 +01:00
|
|
|
strategy:
|
2021-02-01 17:22:32 +01:00
|
|
|
fail-fast: true
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2022-11-01 15:06:13 +01:00
|
|
|
uses: actions/checkout@v3
|
2021-02-01 17:22:32 +01:00
|
|
|
|
2022-02-22 14:42:40 +01:00
|
|
|
- name: Set up Python 3.7
|
2022-11-01 15:06:13 +01:00
|
|
|
uses: actions/setup-python@v4
|
2021-02-01 17:22:32 +01:00
|
|
|
with:
|
2022-02-22 15:37:30 +01:00
|
|
|
python-version: 3.7
|
2021-01-13 11:21:57 +01:00
|
|
|
|
2021-02-01 17:22:32 +01:00
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
bash -x .github/scripts/setup.sh
|
2022-11-09 13:31:15 +01:00
|
|
|
pip install -U pip wheel poetry
|
|
|
|
# Export and then use pip to install into the current env
|
|
|
|
poetry export -o /tmp/requirements.txt --without-hashes --with dev
|
|
|
|
pip install -r /tmp/requirements.txt
|
2022-11-30 13:52:51 +01:00
|
|
|
# We're going to check BOLT quotes, so get the latest version
|
|
|
|
git clone https://github.com/lightning/bolts.git ../${BOLTDIR}
|
2022-12-15 16:00:01 +01:00
|
|
|
- name: Configure
|
|
|
|
run: ./configure
|
|
|
|
- name: Check source
|
|
|
|
run: make -j 4 check-source
|
|
|
|
- name: Check Generated Files have been updated
|
|
|
|
run: make -j 4 check-gen-updated
|
|
|
|
- name: Check docs
|
|
|
|
run: make -j 4 check-doc
|
2022-12-15 16:03:52 +01:00
|
|
|
|
|
|
|
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
|
2022-12-19 18:20:19 +01:00
|
|
|
runs-on: ubuntu-22.04
|
2022-12-15 16:03:52 +01:00
|
|
|
env:
|
|
|
|
COMPAT: 1
|
|
|
|
VALGRIND: 1
|
|
|
|
BOLTDIR: bolts
|
|
|
|
needs:
|
|
|
|
- prebuild
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Set up Python 3.7
|
|
|
|
uses: actions/setup-python@v4
|
|
|
|
with:
|
|
|
|
python-version: 3.7
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
bash -x .github/scripts/setup.sh
|
2022-12-19 18:20:19 +01:00
|
|
|
sudo apt-get install -y -qq lowdown
|
2022-12-15 16:03:52 +01:00
|
|
|
pip install -U pip wheel poetry
|
|
|
|
# Export and then use pip to install into the current env
|
|
|
|
poetry export -o /tmp/requirements.txt --without-hashes --with dev
|
|
|
|
pip install -r /tmp/requirements.txt
|
|
|
|
# We're going to check BOLT quotes, so get the latest version
|
|
|
|
git clone https://github.com/lightning/bolts.git ../${BOLTDIR}
|
|
|
|
|
|
|
|
- name: Build
|
|
|
|
run: |
|
|
|
|
./configure
|
|
|
|
make -j $(nproc) check-units installcheck
|
2022-12-05 15:09:33 +01:00
|
|
|
|
2022-11-09 13:31:15 +01:00
|
|
|
compile:
|
|
|
|
name: Compile CLN ${{ matrix.cfg }}
|
2022-12-19 18:20:19 +01:00
|
|
|
runs-on: ubuntu-22.04
|
2021-02-01 17:22:32 +01:00
|
|
|
env:
|
|
|
|
COMPAT: 1
|
2022-11-09 13:31:15 +01:00
|
|
|
needs:
|
|
|
|
- prebuild
|
2021-02-01 17:22:32 +01:00
|
|
|
strategy:
|
2022-11-09 13:31:15 +01:00
|
|
|
fail-fast: true
|
2021-02-01 17:22:32 +01:00
|
|
|
matrix:
|
|
|
|
include:
|
2022-11-09 13:31:15 +01:00
|
|
|
- CFG: gcc-dev1-exp1
|
|
|
|
DEVELOPER: 1
|
|
|
|
EXPERIMENTAL_FEATURES: 1
|
2021-05-18 13:58:45 +09:30
|
|
|
COMPILER: gcc
|
2022-11-09 13:31:15 +01:00
|
|
|
- CFG: gcc-dev1-exp0
|
|
|
|
DEVELOPER: 1
|
|
|
|
EXPERIMENTAL_FEATURES: 0
|
|
|
|
COMPILER: gcc
|
|
|
|
- CFG: gcc-dev0-exp1
|
2021-05-18 13:58:45 +09:30
|
|
|
DEVELOPER: 0
|
2022-11-09 13:31:15 +01:00
|
|
|
EXPERIMENTAL_FEATURES: 1
|
|
|
|
COMPILER: gcc
|
|
|
|
- CFG: gcc-dev0-exp0
|
2021-05-18 13:58:45 +09:30
|
|
|
DEVELOPER: 0
|
2022-11-09 13:31:15 +01:00
|
|
|
EXPERIMENTAL_FEATURES: 0
|
|
|
|
COMPILER: gcc
|
|
|
|
# While we're at it let's try to compile with clang
|
|
|
|
- CFG: clang-dev1-exp1
|
2021-07-25 20:04:42 +09:30
|
|
|
DEVELOPER: 1
|
2021-05-18 13:58:45 +09:30
|
|
|
EXPERIMENTAL_FEATURES: 1
|
2022-11-09 13:31:15 +01:00
|
|
|
COMPILER: clang
|
2021-02-01 17:22:32 +01:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2022-11-01 15:06:13 +01:00
|
|
|
uses: actions/checkout@v3
|
2021-02-01 17:22:32 +01:00
|
|
|
|
2022-02-22 15:37:30 +01:00
|
|
|
- name: Set up Python 3.7
|
2022-11-01 15:06:13 +01:00
|
|
|
uses: actions/setup-python@v4
|
2021-02-01 17:22:32 +01:00
|
|
|
with:
|
2022-02-22 15:37:30 +01:00
|
|
|
python-version: 3.7
|
2021-02-01 17:22:32 +01:00
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
bash -x .github/scripts/setup.sh
|
2022-12-05 15:09:33 +01:00
|
|
|
|
2021-01-09 16:23:06 +01:00
|
|
|
- name: Build
|
2021-01-13 11:21:57 +01:00
|
|
|
env:
|
|
|
|
VALGRIND: ${{ matrix.VALGRIND }}
|
|
|
|
DEVELOPER: ${{ matrix.DEVELOPER }}
|
|
|
|
EXPERIMENTAL_FEATURES: ${{ matrix.EXPERIMENTAL_FEATURES }}
|
|
|
|
COMPILER: ${{ matrix.COMPILER }}
|
2022-11-09 13:31:15 +01:00
|
|
|
COMPAT: 1
|
|
|
|
CFG: ${{ matrix.CFG }}
|
2021-01-09 16:23:06 +01:00
|
|
|
run: |
|
2022-11-09 13:31:15 +01:00
|
|
|
set -e
|
|
|
|
pip3 install --user pip wheel poetry
|
|
|
|
poetry export -o requirements.txt --with dev --without-hashes
|
|
|
|
python3 -m pip install -r requirements.txt
|
|
|
|
./configure CC="$COMPILER"
|
|
|
|
|
2022-12-15 15:46:19 +01:00
|
|
|
make -j $(nproc) testpack.tar.bz2
|
2022-11-09 13:31:15 +01:00
|
|
|
|
2022-12-15 15:46:19 +01:00
|
|
|
# Rename now so we don't clash
|
2022-12-20 10:11:59 +01:00
|
|
|
mv testpack.tar.bz2 cln-${CFG}.tar.bz2
|
2022-11-09 13:31:15 +01:00
|
|
|
- uses: actions/upload-artifact@v3
|
2022-01-25 13:44:34 +01:00
|
|
|
with:
|
2022-12-20 10:11:59 +01:00
|
|
|
name: cln-${{ matrix.CFG }}.tar.bz2
|
|
|
|
path: cln-${{ matrix.CFG }}.tar.bz2
|
2022-12-05 15:09:33 +01:00
|
|
|
|
|
|
|
integration:
|
|
|
|
name: Test CLN ${{ matrix.cfg }}
|
2022-12-19 18:20:19 +01:00
|
|
|
runs-on: ubuntu-22.04
|
2022-12-05 15:09:33 +01:00
|
|
|
env:
|
|
|
|
COMPAT: 1
|
2022-12-16 14:39:27 +01:00
|
|
|
BITCOIN_VERSION: 0.20.1
|
|
|
|
ELEMENTS_VERSION: 0.18.1.8
|
2022-12-20 10:11:59 +01:00
|
|
|
RUST_PROFILE: release # Has to match the one in the compile step
|
2022-12-05 15:09:33 +01:00
|
|
|
needs:
|
|
|
|
- compile
|
|
|
|
strategy:
|
|
|
|
fail-fast: true
|
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
- CFG: gcc-dev1-exp1
|
|
|
|
DEVELOPER: 1
|
|
|
|
EXPERIMENTAL_FEATURES: 1
|
|
|
|
TEST_DB_PROVIDER: sqlite3
|
|
|
|
COMPILER: gcc
|
|
|
|
- CFG: gcc-dev1-exp0
|
|
|
|
DEVELOPER: 1
|
|
|
|
EXPERIMENTAL_FEATURES: 0
|
|
|
|
TEST_DB_PROVIDER: sqlite3
|
|
|
|
COMPILER: gcc
|
|
|
|
- CFG: gcc-dev0-exp1
|
|
|
|
DEVELOPER: 0
|
|
|
|
EXPERIMENTAL_FEATURES: 1
|
|
|
|
TEST_DB_PROVIDER: sqlite3
|
|
|
|
COMPILER: gcc
|
|
|
|
- CFG: gcc-dev0-exp0
|
|
|
|
DEVELOPER: 0
|
|
|
|
EXPERIMENTAL_FEATURES: 0
|
|
|
|
TEST_DB_PROVIDER: sqlite3
|
|
|
|
COMPILER: gcc
|
|
|
|
# While we're at it let's try to compile with clang
|
|
|
|
- CFG: gcc-dev1-exp1
|
|
|
|
DEVELOPER: 1
|
|
|
|
EXPERIMENTAL_FEATURES: 1
|
|
|
|
TEST_DB_PROVIDER: sqlite3
|
|
|
|
COMPILER: clang
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Set up Python 3.7
|
|
|
|
uses: actions/setup-python@v4
|
|
|
|
with:
|
|
|
|
python-version: 3.7
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
2022-12-15 16:03:52 +01:00
|
|
|
pip3 install --user pip wheel poetry
|
|
|
|
poetry install
|
2022-12-05 15:09:33 +01:00
|
|
|
|
2022-12-16 14:39:27 +01:00
|
|
|
- name: Install bitcoind
|
|
|
|
run: |
|
|
|
|
(
|
|
|
|
cd /tmp/
|
|
|
|
wget https://storage.googleapis.com/c-lightning-tests/bitcoin-$BITCOIN_VERSION-x86_64-linux-gnu.tar.bz2
|
|
|
|
wget -q https://storage.googleapis.com/c-lightning-tests/elements-$ELEMENTS_VERSION-x86_64-linux-gnu.tar.bz2
|
|
|
|
tar -xjf bitcoin-$BITCOIN_VERSION-x86_64-linux-gnu.tar.bz2
|
|
|
|
tar -xjf elements-$ELEMENTS_VERSION-x86_64-linux-gnu.tar.bz2
|
|
|
|
sudo mv bitcoin-$BITCOIN_VERSION/bin/* /usr/local/bin
|
|
|
|
sudo mv elements-$ELEMENTS_VERSION/bin/* /usr/local/bin
|
|
|
|
rm -rf \
|
|
|
|
bitcoin-$BITCOIN_VERSION-x86_64-linux-gnu.tar.gz \
|
|
|
|
bitcoin-$BITCOIN_VERSION \
|
|
|
|
elements-$ELEMENTS_VERSION-x86_64-linux-gnu.tar.bz2 \
|
|
|
|
elements-$ELEMENTS_VERSION
|
|
|
|
)
|
2022-12-05 15:09:33 +01:00
|
|
|
|
|
|
|
- name: Download build
|
|
|
|
uses: actions/download-artifact@v3
|
|
|
|
with:
|
2022-12-20 10:11:59 +01:00
|
|
|
name: cln-${{ matrix.CFG }}.tar.bz2
|
2022-12-05 15:09:33 +01:00
|
|
|
|
|
|
|
- name: Test
|
|
|
|
env:
|
|
|
|
VALGRIND: ${{ matrix.VALGRIND }}
|
|
|
|
DEVELOPER: ${{ matrix.DEVELOPER }}
|
|
|
|
EXPERIMENTAL_FEATURES: ${{ matrix.EXPERIMENTAL_FEATURES }}
|
|
|
|
COMPILER: ${{ matrix.COMPILER }}
|
|
|
|
COMPAT: 1
|
|
|
|
CFG: ${{ matrix.CFG }}
|
|
|
|
SLOW_MACHINE: 1
|
|
|
|
PYTEST_PAR: 10
|
2022-12-15 16:03:52 +01:00
|
|
|
TEST_DEBUG: 1
|
2022-12-05 15:09:33 +01:00
|
|
|
run: |
|
2022-12-20 10:11:59 +01:00
|
|
|
tar -xaf cln-${CFG}.tar.bz2
|
|
|
|
poetry run pytest tests/ -vvv -n ${PYTEST_PAR} ${PYTEST_OPTS}
|
2022-12-19 18:25:31 +01:00
|
|
|
|
|
|
|
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.
|
|
|
|
name: CI completion
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
needs:
|
|
|
|
- integration
|
|
|
|
- check-units
|
|
|
|
steps:
|
|
|
|
- name: Complete
|
|
|
|
run: |
|
|
|
|
echo CI completed successfully
|