mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-27 19:04:22 +01:00
We can require a status to be successful in PRs, but they are referenced by name, and so we'd have to add each matrix job as required. That's rather cumbersome, so have this artificial gather step at the end which signals success on the entire run.
260 lines
7.4 KiB
YAML
260 lines
7.4 KiB
YAML
---
|
|
name: Continuous Integration
|
|
on:
|
|
push:
|
|
branches:
|
|
- "master"
|
|
pull_request:
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
prebuild:
|
|
name: Pre-build checks
|
|
runs-on: ubuntu-20.04
|
|
env:
|
|
RUST: 1
|
|
COMPAT: 1
|
|
BOLTDIR: bolts
|
|
strategy:
|
|
fail-fast: true
|
|
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
|
|
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: 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
|
|
|
|
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-22.04
|
|
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
|
|
sudo apt-get install -y -qq lowdown
|
|
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
|
|
|
|
compile:
|
|
name: Compile CLN ${{ matrix.cfg }}
|
|
runs-on: ubuntu-22.04
|
|
env:
|
|
COMPAT: 1
|
|
needs:
|
|
- prebuild
|
|
strategy:
|
|
fail-fast: true
|
|
matrix:
|
|
include:
|
|
- CFG: gcc-dev1-exp1
|
|
DEVELOPER: 1
|
|
EXPERIMENTAL_FEATURES: 1
|
|
COMPILER: gcc
|
|
- CFG: gcc-dev1-exp0
|
|
DEVELOPER: 1
|
|
EXPERIMENTAL_FEATURES: 0
|
|
COMPILER: gcc
|
|
- CFG: gcc-dev0-exp1
|
|
DEVELOPER: 0
|
|
EXPERIMENTAL_FEATURES: 1
|
|
COMPILER: gcc
|
|
- CFG: gcc-dev0-exp0
|
|
DEVELOPER: 0
|
|
EXPERIMENTAL_FEATURES: 0
|
|
COMPILER: gcc
|
|
# While we're at it let's try to compile with clang
|
|
- CFG: clang-dev1-exp1
|
|
DEVELOPER: 1
|
|
EXPERIMENTAL_FEATURES: 1
|
|
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: |
|
|
bash -x .github/scripts/setup.sh
|
|
|
|
- name: Build
|
|
env:
|
|
VALGRIND: ${{ matrix.VALGRIND }}
|
|
DEVELOPER: ${{ matrix.DEVELOPER }}
|
|
EXPERIMENTAL_FEATURES: ${{ matrix.EXPERIMENTAL_FEATURES }}
|
|
COMPILER: ${{ matrix.COMPILER }}
|
|
COMPAT: 1
|
|
CFG: ${{ matrix.CFG }}
|
|
run: |
|
|
set -e
|
|
export SLOW_MACHINE=1
|
|
|
|
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"
|
|
|
|
make -j $(nproc) testpack.tar.bz2
|
|
|
|
# Rename now so we don't clash
|
|
mv testpack.tar cln-${CFG}.tar
|
|
- uses: actions/upload-artifact@v3
|
|
with:
|
|
name: cln-${{ matrix.CFG }}.tar
|
|
path: cln-${{ matrix.CFG }}.tar
|
|
|
|
integration:
|
|
name: Test CLN ${{ matrix.cfg }}
|
|
runs-on: ubuntu-22.04
|
|
env:
|
|
COMPAT: 1
|
|
BITCOIN_VERSION: 0.20.1
|
|
ELEMENTS_VERSION: 0.18.1.8
|
|
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: |
|
|
pip3 install --user pip wheel poetry
|
|
poetry install
|
|
|
|
- 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
|
|
)
|
|
|
|
- name: Download build
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
name: cln-${{ matrix.CFG }}.tar
|
|
|
|
- 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
|
|
TEST_DEBUG: 1
|
|
run: |
|
|
tar -xf cln-${CFG}.tar
|
|
poetry run pytest tests/ -n ${PYTEST_PAR} ${PYTEST_OPTS}
|
|
|
|
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
|