mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-22 08:34:20 +01:00
ci: Split out the unit tests
They are run in parallel with the integration tests, not on the critical path, but can be a bit lengthy since they build a log of C code, and run in valgrind.
This commit is contained in:
committed by
Rusty Russell
parent
a650dcb26d
commit
e7ee40e951
55
.github/workflows/ci.yaml
vendored
55
.github/workflows/ci.yaml
vendored
@@ -13,7 +13,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
RUST: 1
|
RUST: 1
|
||||||
COMPAT: 1
|
COMPAT: 1
|
||||||
BOLTDIR: /tmp/bolts
|
BOLTDIR: bolts
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: true
|
fail-fast: true
|
||||||
steps:
|
steps:
|
||||||
@@ -38,14 +38,45 @@ jobs:
|
|||||||
run: ./configure
|
run: ./configure
|
||||||
- name: Check source
|
- name: Check source
|
||||||
run: make -j 4 check-source
|
run: make -j 4 check-source
|
||||||
- name: Check units
|
|
||||||
run: make -j 4 check-units
|
|
||||||
- name: Check Generated Files have been updated
|
- name: Check Generated Files have been updated
|
||||||
run: make -j 4 check-gen-updated
|
run: make -j 4 check-gen-updated
|
||||||
- name: Check docs
|
- name: Check docs
|
||||||
run: make -j 4 check-doc
|
run: make -j 4 check-doc
|
||||||
- name: Check install
|
|
||||||
run: make -j 4 installcheck
|
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-20.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
|
||||||
|
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:
|
compile:
|
||||||
name: Compile CLN ${{ matrix.cfg }}
|
name: Compile CLN ${{ matrix.cfg }}
|
||||||
@@ -166,7 +197,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
echo Nothing to do
|
pip3 install --user pip wheel poetry
|
||||||
|
poetry install
|
||||||
|
|
||||||
|
|
||||||
- name: Download build
|
- name: Download build
|
||||||
@@ -184,12 +216,7 @@ jobs:
|
|||||||
CFG: ${{ matrix.CFG }}
|
CFG: ${{ matrix.CFG }}
|
||||||
SLOW_MACHINE: 1
|
SLOW_MACHINE: 1
|
||||||
PYTEST_PAR: 10
|
PYTEST_PAR: 10
|
||||||
|
TEST_DEBUG: 1
|
||||||
run: |
|
run: |
|
||||||
set -e
|
tar -xf cln-${CFG}.tar
|
||||||
tar -xvf cln-${CFG}.tar
|
poetry run pytest tests/ -n ${PYTEST_PAR} ${PYTEST_OPTS}
|
||||||
|
|
||||||
pip3 install --user pip wheel poetry
|
|
||||||
poetry export -o requirements.txt --with dev --without-hashes
|
|
||||||
python3 -m pip install -r requirements.txt
|
|
||||||
|
|
||||||
poetry run make pytest
|
|
||||||
|
|||||||
Reference in New Issue
Block a user