mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
CI: use prebuild for (almost all) ci steps.
With the exception of fuzzing, make all builds in the `compile` job, and simply download them in the other steps. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
193
.github/workflows/ci.yaml
vendored
193
.github/workflows/ci.yaml
vendored
@@ -62,6 +62,75 @@ jobs:
|
|||||||
- name: Check docs
|
- name: Check docs
|
||||||
run: make -j 4 check-doc
|
run: make -j 4 check-doc
|
||||||
|
|
||||||
|
compile:
|
||||||
|
name: Compile CLN ${{ matrix.cfg }}
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
timeout-minutes: 30
|
||||||
|
needs:
|
||||||
|
- prebuild
|
||||||
|
strategy:
|
||||||
|
fail-fast: true
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- CFG: gcc-dev1
|
||||||
|
DEVELOPER: 1
|
||||||
|
VALGRIND: 1
|
||||||
|
COMPILER: gcc
|
||||||
|
- CFG: gcc-dev0
|
||||||
|
DEVELOPER: 0
|
||||||
|
VALGRIND: 1
|
||||||
|
COMPILER: gcc
|
||||||
|
# While we're at it let's try to compile with clang
|
||||||
|
- CFG: clang-dev1
|
||||||
|
DEVELOPER: 1
|
||||||
|
VALGRIND: 1
|
||||||
|
COMPILER: clang
|
||||||
|
- CFG: clang-sanitizers
|
||||||
|
DEVELOPER: 1
|
||||||
|
COMPILER: clang
|
||||||
|
ASAN: 1
|
||||||
|
UBSAN: 1
|
||||||
|
VALGRIND: 0
|
||||||
|
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:
|
||||||
|
DEVELOPER: ${{ matrix.DEVELOPER }}
|
||||||
|
COMPILER: ${{ matrix.COMPILER }}
|
||||||
|
ASAN: ${{ matrix.ASAN }}
|
||||||
|
UBSAN: ${{ matrix.UBSAN }}
|
||||||
|
VALGRIND: ${{ matrix.VALGRIND }}
|
||||||
|
COMPAT: 1
|
||||||
|
CFG: ${{ matrix.CFG }}
|
||||||
|
run: |
|
||||||
|
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 --enable-debugbuild CC="$COMPILER"
|
||||||
|
|
||||||
|
make -j $(nproc) testpack.tar.bz2
|
||||||
|
|
||||||
|
# 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@v2.2.4
|
||||||
|
with:
|
||||||
|
name: cln-${{ matrix.CFG }}.tar.bz2
|
||||||
|
path: cln-${{ matrix.CFG }}.tar.bz2
|
||||||
|
|
||||||
check-units:
|
check-units:
|
||||||
# The unit test checks are not in the critical path (not dependent
|
# The unit test checks are not in the critical path (not dependent
|
||||||
# on the integration tests), so run them with `valgrind`
|
# on the integration tests), so run them with `valgrind`
|
||||||
@@ -71,7 +140,15 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
BOLTDIR: bolts
|
BOLTDIR: bolts
|
||||||
needs:
|
needs:
|
||||||
- prebuild
|
- compile
|
||||||
|
strategy:
|
||||||
|
fail-fast: true
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- CFG: gcc-dev1
|
||||||
|
VALGRIND: 1
|
||||||
|
- CFG: clang-sanitizers
|
||||||
|
VALGRIND: 0
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
@@ -92,46 +169,15 @@ jobs:
|
|||||||
# We're going to check BOLT quotes, so get the latest version
|
# We're going to check BOLT quotes, so get the latest version
|
||||||
git clone https://github.com/lightning/bolts.git ../${BOLTDIR}
|
git clone https://github.com/lightning/bolts.git ../${BOLTDIR}
|
||||||
|
|
||||||
- name: Build
|
|
||||||
run: |
|
|
||||||
./configure --enable-debugbuild --enable-valgrind
|
|
||||||
make -j $(nproc) check-units installcheck
|
|
||||||
|
|
||||||
check-units-sanitizers:
|
|
||||||
name: Run unit tests with ASan and UBSan
|
|
||||||
runs-on: ubuntu-22.04
|
|
||||||
timeout-minutes: 30
|
|
||||||
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
|
|
||||||
|
|
||||||
- name: Download build
|
- name: Download build
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: cln-${{ matrix.CFG }}.tar.bz2
|
name: cln-${{ matrix.CFG }}.tar.bz2
|
||||||
|
|
||||||
- name: Build
|
- name: Check
|
||||||
run: |
|
run: |
|
||||||
tar -xaf cln-${CFG}.tar.bz2
|
tar -xaf cln-${{ matrix.CFG }}.tar.bz2
|
||||||
poetry run pytest tests/ -vvv -n ${PYTEST_PAR} ${PYTEST_OPTS}
|
make -j $(nproc) check-units installcheck VALGRIND=${{ matrix.VALGRIND }}
|
||||||
./configure --enable-debugbuild --enable-address-sanitizer --enable-ub-sanitizer --disable-valgrind CC=clang
|
|
||||||
make -j $(nproc) check-units installcheck
|
|
||||||
|
|
||||||
check-fuzz:
|
check-fuzz:
|
||||||
name: Run fuzz regression tests
|
name: Run fuzz regression tests
|
||||||
@@ -160,70 +206,6 @@ jobs:
|
|||||||
./configure --enable-debugbuild --enable-fuzzing --enable-developer --disable-valgrind CC=clang
|
./configure --enable-debugbuild --enable-fuzzing --enable-developer --disable-valgrind CC=clang
|
||||||
make -j $(nproc) check-fuzz
|
make -j $(nproc) check-fuzz
|
||||||
|
|
||||||
compile:
|
|
||||||
name: Compile CLN ${{ matrix.cfg }}
|
|
||||||
runs-on: ubuntu-22.04
|
|
||||||
timeout-minutes: 30
|
|
||||||
needs:
|
|
||||||
- prebuild
|
|
||||||
strategy:
|
|
||||||
fail-fast: true
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- CFG: gcc-dev1
|
|
||||||
DEVELOPER: 1
|
|
||||||
COMPILER: gcc
|
|
||||||
- CFG: gcc-dev0
|
|
||||||
DEVELOPER: 0
|
|
||||||
COMPILER: gcc
|
|
||||||
# While we're at it let's try to compile with clang
|
|
||||||
- CFG: clang-dev1
|
|
||||||
DEVELOPER: 1
|
|
||||||
COMPILER: clang
|
|
||||||
- CFG: clang-asan
|
|
||||||
DEVELOPER: 1
|
|
||||||
COMPILER: clang
|
|
||||||
ASAN: 1
|
|
||||||
UBSAN: 1
|
|
||||||
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:
|
|
||||||
DEVELOPER: ${{ matrix.DEVELOPER }}
|
|
||||||
COMPILER: ${{ matrix.COMPILER }}
|
|
||||||
ASAN: ${{ matrix.ASAN }}
|
|
||||||
UBSAN: ${{ matrix.UBSAN }}
|
|
||||||
COMPAT: 1
|
|
||||||
CFG: ${{ matrix.CFG }}
|
|
||||||
run: |
|
|
||||||
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 --enable-debugbuild CC="$COMPILER"
|
|
||||||
|
|
||||||
make -j $(nproc) testpack.tar.bz2
|
|
||||||
|
|
||||||
# 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@v2.2.4
|
|
||||||
with:
|
|
||||||
name: cln-${{ matrix.CFG }}.tar.bz2
|
|
||||||
path: cln-${{ matrix.CFG }}.tar.bz2
|
|
||||||
|
|
||||||
integration:
|
integration:
|
||||||
name: Test CLN ${{ matrix.name }}
|
name: Test CLN ${{ matrix.name }}
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
@@ -401,7 +383,7 @@ jobs:
|
|||||||
TEST_DEBUG: 1
|
TEST_DEBUG: 1
|
||||||
PYTEST_OPTS: --test-group-random-seed=42 --timeout=1800
|
PYTEST_OPTS: --test-group-random-seed=42 --timeout=1800
|
||||||
needs:
|
needs:
|
||||||
- prebuild
|
- compile
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: true
|
fail-fast: true
|
||||||
matrix:
|
matrix:
|
||||||
@@ -447,10 +429,13 @@ jobs:
|
|||||||
- name: Install bitcoind
|
- name: Install bitcoind
|
||||||
run: .github/scripts/install-bitcoind.sh
|
run: .github/scripts/install-bitcoind.sh
|
||||||
|
|
||||||
- name: Build
|
- name: Download build
|
||||||
run: |
|
uses: actions/download-artifact@v3
|
||||||
./configure CC=clang --enable-address-sanitizer --enable-ub-sanitizer --disable-valgrind --enable-developer --enable-debugbuild
|
with:
|
||||||
make -j $(nproc)
|
name: cln-clang-sanitizers.tar.bz2
|
||||||
|
|
||||||
|
- name: Unpack build
|
||||||
|
run: tar -xvjf cln-clang-sanitizers.tar.bz2
|
||||||
|
|
||||||
- name: Test
|
- name: Test
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
Reference in New Issue
Block a user