From 5160dff8be5ba80e8a69c0d4e68eb5ef4ec0d40b Mon Sep 17 00:00:00 2001 From: Elias Rohrer Date: Wed, 4 Sep 2024 11:10:13 +0200 Subject: [PATCH] Check workspace members with default features individually in CI Previously, we would only check the workspace as a whole. This however would mean that we would check/test crates with `lightning`'s default features enabled, allowing failures-to-build under the crates own default features to slip through, if they didn't explicitly enable `lightning/std`, for example. Here, we extend the CI to check the workspace as a whole but then run checks, tests, and doc generation on the workspace members individually, asserting that all of them build even when not built as part of the same workspace as `lightning`. --- ci/ci-tests.sh | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/ci/ci-tests.sh b/ci/ci-tests.sh index aff1a46c49e..2c152444eef 100755 --- a/ci/ci-tests.sh +++ b/ci/ci-tests.sh @@ -27,11 +27,31 @@ PIN_RELEASE_DEPS # pin the release dependencies in our main workspace export RUST_BACKTRACE=1 -echo -e "\n\nBuilding and testing all workspace crates..." -cargo test --verbose --color always +echo -e "\n\nChecking the full workspace." cargo check --verbose --color always -echo -e "\n\nBuilding and testing Block Sync Clients with features" +WORKSPACE_MEMBERS=( + lightning + lightning-types + lightning-block-sync + lightning-invoice + lightning-net-tokio + lightning-persister + lightning-background-processor + lightning-rapid-gossip-sync + lightning-custom-message + lightning-transaction-sync + possiblyrandom +) + +echo -e "\n\nChecking, testing, and building docs for all workspace members individually..." +for DIR in "${WORKSPACE_MEMBERS[@]}"; do + cargo test -p "$DIR" --verbose --color always + cargo check -p "$DIR" --verbose --color always + cargo doc -p "$DIR" --document-private-items +done + +echo -e "\n\nChecking and testing Block Sync Clients with features" cargo test -p lightning-block-sync --verbose --color always --features rest-client cargo check -p lightning-block-sync --verbose --color always --features rest-client