ci: Use bzip2 and release to reduce artifact size

This commit is contained in:
Christian Decker 2022-12-20 10:11:59 +01:00 committed by Rusty Russell
parent b40fd3efbd
commit e76618e2a6
3 changed files with 21 additions and 13 deletions

View file

@ -9,7 +9,13 @@ on:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
# Makes the upload-artifact work more reliably at the cost
# of a bit of compile time.
RUST_PROFILE: release
SLOW_MACHINE: 1
jobs:
prebuild:
name: Pre-build checks
@ -138,8 +144,6 @@ jobs:
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
@ -148,11 +152,11 @@ jobs:
make -j $(nproc) testpack.tar.bz2
# Rename now so we don't clash
mv testpack.tar cln-${CFG}.tar
mv testpack.tar.bz2 cln-${CFG}.tar.bz2
- uses: actions/upload-artifact@v3
with:
name: cln-${{ matrix.CFG }}.tar
path: cln-${{ matrix.CFG }}.tar
name: cln-${{ matrix.CFG }}.tar.bz2
path: cln-${{ matrix.CFG }}.tar.bz2
integration:
name: Test CLN ${{ matrix.cfg }}
@ -161,6 +165,7 @@ jobs:
COMPAT: 1
BITCOIN_VERSION: 0.20.1
ELEMENTS_VERSION: 0.18.1.8
RUST_PROFILE: release # Has to match the one in the compile step
needs:
- compile
strategy:
@ -227,7 +232,7 @@ jobs:
- name: Download build
uses: actions/download-artifact@v3
with:
name: cln-${{ matrix.CFG }}.tar
name: cln-${{ matrix.CFG }}.tar.bz2
- name: Test
env:
@ -241,8 +246,8 @@ jobs:
PYTEST_PAR: 10
TEST_DEBUG: 1
run: |
tar -xf cln-${CFG}.tar
poetry run pytest tests/ -n ${PYTEST_PAR} ${PYTEST_OPTS}
tar -xaf cln-${CFG}.tar.bz2
poetry run pytest tests/ -vvv -n ${PYTEST_PAR} ${PYTEST_OPTS}
gather:
# A dummy task that depends on the full matrix of tests, and

View file

@ -1,7 +1,7 @@
cln-rpc-wrongdir:
$(MAKE) -C .. cln-rpc-all
CLN_RPC_EXAMPLES := target/debug/examples/cln-rpc-getinfo
CLN_RPC_EXAMPLES := target/${RUST_PROFILE}/examples/cln-rpc-getinfo
CLN_RPC_GENALL = cln-rpc/src/model.rs
CLN_RPC_SOURCES = $(shell find cln-rpc -name *.rs) ${CLN_RPC_GENALL}
JSON_SCHEMAS = $(wildcard doc/schemas/*.request.json doc/schemas/*.schema.json)

View file

@ -8,6 +8,7 @@ from pyln.testing.utils import env, TEST_NETWORK, wait_for
import grpc
import pytest
import subprocess
import os
# Skip the entire module if we don't have Rust.
pytestmark = pytest.mark.skipif(
@ -15,6 +16,8 @@ pytestmark = pytest.mark.skipif(
reason='RUST is not enabled skipping rust-dependent tests'
)
RUST_PROFILE = os.environ.get("RUST_PROFILE", "debug")
def wait_for_grpc_start(node):
"""This can happen before "public key" which start() swallows"""
@ -23,7 +26,7 @@ def wait_for_grpc_start(node):
def test_rpc_client(node_factory):
l1 = node_factory.get_node()
bin_path = Path.cwd() / "target" / "debug" / "examples" / "cln-rpc-getinfo"
bin_path = Path.cwd() / "target" / RUST_PROFILE / "examples" / "cln-rpc-getinfo"
rpc_path = Path(l1.daemon.lightning_dir) / TEST_NETWORK / "lightning-rpc"
out = subprocess.check_output([bin_path, rpc_path], stderr=subprocess.STDOUT)
assert(b'0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518' in out)
@ -32,7 +35,7 @@ def test_rpc_client(node_factory):
def test_plugin_start(node_factory):
"""Start a minimal plugin and ensure it is well-behaved
"""
bin_path = Path.cwd() / "target" / "debug" / "examples" / "cln-plugin-startup"
bin_path = Path.cwd() / "target" / RUST_PROFILE / "examples" / "cln-plugin-startup"
l1 = node_factory.get_node(options={"plugin": str(bin_path), 'test-option': 31337})
l2 = node_factory.get_node()
@ -75,7 +78,7 @@ def test_plugin_start(node_factory):
def test_plugin_optional_opts(node_factory):
"""Start a minimal plugin and ensure it is well-behaved
"""
bin_path = Path.cwd() / "target" / "debug" / "examples" / "cln-plugin-startup"
bin_path = Path.cwd() / "target" / RUST_PROFILE / "examples" / "cln-plugin-startup"
l1 = node_factory.get_node(options={"plugin": str(bin_path), 'opt-option': 31337})
opts = l1.rpc.testoptions()
print(opts)