Skip to content

Commit f59bcc8

Browse files
committed
Merge #19: Add support for corepc
d6bcfac Add support for corepc (Tobin C. Harding) Pull request description: Currently the `corpec` repository excludes the `node` crate because it has unusual feature requirements - it requires at least one version feature. Add support for testing `node`. The logic in `build_and_test` is general and uses a new var defined in `contrib/test_vars.sh` but does not require this var to exist. The logic in `do_lint` is ugly and specific to `node`. I couldn't think of a cleaner way to do it. ACKs for top commit: apoelstra: ACK d6bcfac Tree-SHA512: f000ff35caa2c69d25d634d9db015cc716f917e417137de4b2034aa9091f33ab166ad448c964e219d3404464394ccfaa4921460b32bf2c86cd106f9c00b029d9
2 parents 9540345 + d6bcfac commit f59bcc8

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

ci/run_task.sh

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,9 @@ build_and_test() {
132132
verbose_say "FEATURES_WITH_NO_STD: ${FEATURES_WITH_NO_STD}"
133133
verbose_say "FEATURES_WITHOUT_STD: ${FEATURES_WITHOUT_STD}"
134134
verbose_say "EXAMPLES: ${EXAMPLES:-}"
135+
if [[ -v EXACT_FEATURES && ${#EXACT_FEATURES[@]} -gt 0 ]]; then
136+
verbose_say "EXACT_FEATURES: ${EXACT_FEATURES[*]}"
137+
fi
135138
fi
136139
pushd "$REPO_DIR/$crate" > /dev/null
137140

@@ -164,8 +167,14 @@ do_test() {
164167
# Each crate defines its own feature matrix test so feature combinations
165168
# can be better controlled.
166169
do_feature_matrix() {
170+
# For crates that have unusual feature requirements (e.g. `corepc`).
171+
if [[ -v EXACT_FEATURES && ${#EXACT_FEATURES[@]} -gt 0 ]]; then
172+
for features in "${EXACT_FEATURES[@]}"; do
173+
$cargo build --no-default-features --features="$features"
174+
$cargo test --no-default-features --features="$features"
175+
done
167176
# rust-miniscript only: https://github.com/rust-bitcoin/rust-miniscript/issues/681
168-
if [ -n "${FEATURES_WITH_NO_STD}" ]; then
177+
elif [ -n "${FEATURES_WITH_NO_STD}" ]; then
169178
$cargo build --no-default-features --features="no-std"
170179
$cargo test --no-default-features --features="no-std"
171180

@@ -219,10 +228,14 @@ loop_features() {
219228
do_lint() {
220229
need_nightly
221230

222-
# Lint various feature combinations to try and catch mistakes in feature gating.
223-
$cargo clippy --workspace --all-targets --keep-going -- -D warnings
224231
$cargo clippy --workspace --all-targets --all-features --keep-going -- -D warnings
225-
$cargo clippy --workspace --all-targets --no-default-features --keep-going -- -D warnings
232+
233+
# Ugly hack to skip `corpec` because `node` does not build with no default features.
234+
if echo "$REPO_DIR" | grep -viq "corepc"; then
235+
# Lint various feature combinations to try and catch mistakes in feature gating.
236+
$cargo clippy --workspace --all-targets --keep-going -- -D warnings
237+
$cargo clippy --workspace --all-targets --no-default-features --keep-going -- -D warnings
238+
fi
226239
}
227240

228241
# We should not have any duplicate dependencies. This catches mistakes made upgrading dependencies
@@ -343,3 +356,4 @@ need_nightly() {
343356
#
344357
main "$@"
345358
exit 0
359+

0 commit comments

Comments
 (0)