]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Check workspace members with default features individually in CI
authorElias Rohrer <dev@tnull.de>
Wed, 4 Sep 2024 09:10:13 +0000 (11:10 +0200)
committerElias Rohrer <dev@tnull.de>
Wed, 18 Sep 2024 07:07:58 +0000 (09:07 +0200)
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

index 0177112201744737d1f281a84fe6dad2f1a3e0bc..92068f7cc33d3340b19fea3669af28f662ab87bf 100755 (executable)
@@ -30,11 +30,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