Skip to content

Commit 6b0eeea

Browse files
committed
Remove redundant cargo check/test calls from CI scripts
- Remove `cargo check` calls that immediately followed `cargo test` with the same crate and features, as `cargo test` already compiles everything that `cargo check` would. - Add `--tests` to `cargo check` calls that precede `cargo test`, so test code is also checked for compilation errors. - Replace per-member `cargo doc` loop with `cargo doc --workspace`. - Move feature-specific `cargo check` for lightning-transaction-sync into the skip branch only, avoiding redundant work when tests run. - Remove redundant `cargo test -p lightning-custom-message` already covered by the workspace-level `cargo test`. - Fix stale "except lightning-transaction-sync" comments, as that crate was moved back into the workspace in b19848e. AI tools were used in preparing this commit.
1 parent 90b79e4 commit 6b0eeea

File tree

3 files changed

+12
-28
lines changed

3 files changed

+12
-28
lines changed

ci/ci-tests-features.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,12 @@ set -eox pipefail
44
# shellcheck source=ci/ci-tests-common.sh
55
source "$(dirname "$0")/ci-tests-common.sh"
66

7-
echo -e "\n\nChecking and testing lightning with features"
7+
echo -e "\n\nTesting lightning with features"
88
cargo test -p lightning --quiet --color always --features dnssec
9-
cargo check -p lightning --quiet --color always --features dnssec
109
cargo doc -p lightning --quiet --document-private-items --features dnssec
1110

12-
echo -e "\n\nChecking and testing lightning-persister with features"
11+
echo -e "\n\nTesting lightning-persister with features"
1312
cargo test -p lightning-persister --quiet --color always --features tokio
14-
cargo check -p lightning-persister --quiet --color always --features tokio
1513
cargo doc -p lightning-persister --quiet --document-private-items --features tokio
1614

1715
echo -e "\n\nTest backtrace-debug builds"

ci/ci-tests-sync.sh

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,17 @@ source "$(dirname "$0")/ci-tests-common.sh"
77
echo -e "\n\nChecking and testing Block Sync Clients with features"
88

99
cargo test -p lightning-block-sync --quiet --color always --features rest-client
10-
cargo check -p lightning-block-sync --quiet --color always --features rest-client
1110
cargo test -p lightning-block-sync --quiet --color always --features rpc-client
12-
cargo check -p lightning-block-sync --quiet --color always --features rpc-client
1311
cargo test -p lightning-block-sync --quiet --color always --features rpc-client,rest-client
14-
cargo check -p lightning-block-sync --quiet --color always --features rpc-client,rest-client
1512
cargo test -p lightning-block-sync --quiet --color always --features rpc-client,rest-client,tokio
16-
cargo check -p lightning-block-sync --quiet --color always --features rpc-client,rest-client,tokio
17-
18-
echo -e "\n\nChecking Transaction Sync Clients with features."
19-
cargo check -p lightning-transaction-sync --quiet --color always --features esplora-blocking
20-
cargo check -p lightning-transaction-sync --quiet --color always --features esplora-async
21-
cargo check -p lightning-transaction-sync --quiet --color always --features esplora-async-https
22-
cargo check -p lightning-transaction-sync --quiet --color always --features electrum
2313

2414
if [ -z "$CI_ENV" ] && [[ -z "$BITCOIND_EXE" || -z "$ELECTRS_EXE" ]]; then
2515
echo -e "\n\nSkipping testing Transaction Sync Clients due to BITCOIND_EXE or ELECTRS_EXE being unset."
26-
cargo check -p lightning-transaction-sync --tests
16+
cargo check -p lightning-transaction-sync --tests --quiet --color always
17+
cargo check -p lightning-transaction-sync --tests --quiet --color always --features esplora-blocking
18+
cargo check -p lightning-transaction-sync --tests --quiet --color always --features esplora-async
19+
cargo check -p lightning-transaction-sync --tests --quiet --color always --features esplora-async-https
20+
cargo check -p lightning-transaction-sync --tests --quiet --color always --features electrum
2721
else
2822
echo -e "\n\nTesting Transaction Sync Clients with features."
2923
cargo test -p lightning-transaction-sync --quiet --color always --features esplora-blocking

ci/ci-tests-workspace.sh

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,23 @@
11
#!/bin/bash
2-
#shellcheck disable=SC2002,SC2207
32
set -eox pipefail
43

54
# shellcheck source=ci/ci-tests-common.sh
65
source "$(dirname "$0")/ci-tests-common.sh"
76

8-
echo -e "\n\nChecking the workspace, except lightning-transaction-sync."
9-
cargo check --quiet --color always
7+
echo -e "\n\nChecking the workspace."
8+
cargo check --tests --quiet --color always
109

11-
WORKSPACE_MEMBERS=( $(cat Cargo.toml | tr '\n' '\r' | sed 's/\r //g' | tr '\r' '\n' | grep '^members =' | sed 's/members.*=.*\[//' | tr -d '"' | tr ',' ' ') )
12-
13-
echo -e "\n\nTesting the workspace, except lightning-transaction-sync."
10+
echo -e "\n\nTesting the workspace."
1411
cargo test --quiet --color always
1512

1613
echo -e "\n\nTesting upgrade from prior versions of LDK"
1714
pushd lightning-tests
1815
cargo test --quiet
1916
popd
2017

21-
echo -e "\n\nChecking and building docs for all workspace members individually..."
22-
for DIR in "${WORKSPACE_MEMBERS[@]}"; do
23-
cargo check -p "$DIR" --quiet --color always
24-
cargo doc -p "$DIR" --quiet --document-private-items
25-
done
18+
echo -e "\n\nBuilding docs for all workspace members."
19+
cargo doc --workspace --quiet --document-private-items
2620

27-
echo -e "\n\nTest Custom Message Macros"
28-
cargo test -p lightning-custom-message --quiet --color always
2921
[ "$CI_MINIMIZE_DISK_USAGE" != "" ] && cargo clean
3022

3123
# Test that we can build downstream code with only the "release pins".

0 commit comments

Comments
 (0)