Skip to content

Commit ea7b1ce

Browse files
committed
Gate set_test_offer and add HRN test config
1 parent a4d5613 commit ea7b1ce

File tree

6 files changed

+23
-12
lines changed

6 files changed

+23
-12
lines changed

.github/workflows/kotlin.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ jobs:
1313
env:
1414
LDK_NODE_JVM_DIR: bindings/kotlin/ldk-node-jvm
1515
LDK_NODE_ANDROID_DIR: bindings/kotlin/ldk-node-android
16+
RUSTFLAGS: "--cfg hrn_tests"
1617

1718
steps:
1819
- name: Checkout repository

.github/workflows/python.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
uses: astral-sh/setup-uv@v7
2222

2323
- name: Generate Python bindings
24-
run: ./scripts/uniffi_bindgen_generate_python.sh
24+
run: RUSTFLAGS="--cfg hrn_tests" ./scripts/uniffi_bindgen_generate_python.sh
2525

2626
- name: Start bitcoind and electrs
2727
run: docker compose up -d

.github/workflows/rust.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,23 +72,31 @@ jobs:
7272
echo "BITCOIND_EXE=$( pwd )/bin/bitcoind-${{ runner.os }}-${{ runner.arch }}" >> "$GITHUB_ENV"
7373
echo "ELECTRS_EXE=$( pwd )/bin/electrs-${{ runner.os }}-${{ runner.arch }}" >> "$GITHUB_ENV"
7474
- name: Build on Rust ${{ matrix.toolchain }}
75+
env:
76+
RUSTFLAGS: "--cfg hrn_tests"
7577
run: cargo build --verbose --color always
7678
- name: Build with UniFFI support on Rust ${{ matrix.toolchain }}
7779
if: matrix.build-uniffi
80+
env:
81+
RUSTFLAGS: "--cfg hrn_tests"
7882
run: cargo build --features uniffi --verbose --color always
7983
- name: Check release build on Rust ${{ matrix.toolchain }}
84+
env:
85+
RUSTFLAGS: "--cfg hrn_tests"
8086
run: cargo check --release --verbose --color always
8187
- name: Check release build with UniFFI support on Rust ${{ matrix.toolchain }}
8288
if: matrix.build-uniffi
89+
env:
90+
RUSTFLAGS: "--cfg hrn_tests"
8391
run: cargo check --release --features uniffi --verbose --color always
8492
- name: Test on Rust ${{ matrix.toolchain }}
8593
if: "matrix.platform != 'windows-latest'"
8694
run: |
87-
RUSTFLAGS="--cfg no_download --cfg cycle_tests" cargo test
95+
RUSTFLAGS="--cfg no_download --cfg cycle_tests --cfg hrn_tests" cargo test
8896
- name: Test with UniFFI support on Rust ${{ matrix.toolchain }}
8997
if: "matrix.platform != 'windows-latest' && matrix.build-uniffi"
9098
run: |
91-
RUSTFLAGS="--cfg no_download --cfg cycle_tests" cargo test --features uniffi
99+
RUSTFLAGS="--cfg no_download --cfg cycle_tests --cfg hrn_tests" cargo test --features uniffi
92100
93101
linting:
94102
name: Linting
@@ -102,14 +110,14 @@ jobs:
102110
rustup component add clippy
103111
- name: Ban `unwrap` in library code
104112
run: |
105-
cargo clippy --lib --verbose --color always -- -A warnings -D clippy::unwrap_used -A clippy::tabs_in_doc_comments
106-
cargo clippy --lib --features uniffi --verbose --color always -- -A warnings -D clippy::unwrap_used -A clippy::tabs_in_doc_comments
113+
RUSTFLAGS="--cfg hrn_tests" cargo clippy --lib --verbose --color always -- -A warnings -D clippy::unwrap_used -A clippy::tabs_in_doc_comments
114+
RUSTFLAGS="--cfg hrn_tests" cargo clippy --lib --features uniffi --verbose --color always -- -A warnings -D clippy::unwrap_used -A clippy::tabs_in_doc_comments
107115
108116
doc:
109117
name: Documentation
110118
runs-on: ubuntu-latest
111119
env:
112-
RUSTDOCFLAGS: -Dwarnings
120+
RUSTDOCFLAGS: "-Dwarnings --cfg hrn_tests"
113121
steps:
114122
- uses: actions/checkout@v6
115123
- uses: dtolnay/rust-toolchain@nightly

.github/workflows/swift.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ jobs:
1818
run: rustup default stable
1919

2020
- name: Generate Swift bindings
21-
run: ./scripts/uniffi_bindgen_generate_swift.sh
21+
run: RUSTFLAGS="--cfg hrn_tests" ./scripts/uniffi_bindgen_generate_swift.sh

scripts/uniffi_bindgen_generate_kotlin.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ PROJECT_DIR="ldk-node-jvm"
55
PACKAGE_DIR="org/lightningdevkit/ldknode"
66
UNIFFI_BINDGEN_BIN="cargo run --manifest-path bindings/uniffi-bindgen/Cargo.toml"
77

8+
export RUSTFLAGS="${RUSTFLAGS}"
9+
810
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
911
rustup target add x86_64-unknown-linux-gnu || exit 1
1012
cargo build --release --target x86_64-unknown-linux-gnu --features uniffi || exit 1
@@ -29,6 +31,6 @@ else
2931
fi
3032

3133
mkdir -p "$BINDINGS_DIR"/"$PROJECT_DIR"/lib/src/main/kotlin/"$PACKAGE_DIR" || exit 1
32-
$UNIFFI_BINDGEN_BIN generate bindings/ldk_node.udl --lib-file "$DYNAMIC_LIB_PATH" --language kotlin -o "$TARGET_DIR" || exit 1
34+
RUSTFLAGS="${RUSTFLAGS}" $UNIFFI_BINDGEN_BIN generate bindings/ldk_node.udl --lib-file "$DYNAMIC_LIB_PATH" --language kotlin -o "$TARGET_DIR" || exit 1
3335

3436
cp "$TARGET_DIR"/"$PACKAGE_DIR"/ldk_node.kt "$BINDINGS_DIR"/"$PROJECT_DIR"/lib/src/main/kotlin/"$PACKAGE_DIR"/ || exit 1

scripts/uniffi_bindgen_generate_kotlin_android.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ case "$OSTYPE" in
3535
PATH="$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/$LLVM_ARCH_PATH/bin:$PATH"
3636

3737
rustup target add x86_64-linux-android aarch64-linux-android armv7-linux-androideabi
38-
RUSTFLAGS="-C link-args=-Wl,-z,max-page-size=16384,-z,common-page-size=16384" CFLAGS="-D__ANDROID_MIN_SDK_VERSION__=21" AR=llvm-ar CARGO_TARGET_X86_64_LINUX_ANDROID_LINKER="x86_64-linux-android21-clang" CC="x86_64-linux-android21-clang" cargo build --profile release-smaller --features uniffi --target x86_64-linux-android || exit 1
39-
RUSTFLAGS="-C link-args=-Wl,-z,max-page-size=16384,-z,common-page-size=16384" CFLAGS="-D__ANDROID_MIN_SDK_VERSION__=21" AR=llvm-ar CARGO_TARGET_ARMV7_LINUX_ANDROIDEABI_LINKER="armv7a-linux-androideabi21-clang" CC="armv7a-linux-androideabi21-clang" cargo build --profile release-smaller --features uniffi --target armv7-linux-androideabi || exit 1
40-
RUSTFLAGS="-C link-args=-Wl,-z,max-page-size=16384,-z,common-page-size=16384" CFLAGS="-D__ANDROID_MIN_SDK_VERSION__=21" AR=llvm-ar CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER="aarch64-linux-android21-clang" CC="aarch64-linux-android21-clang" cargo build --profile release-smaller --features uniffi --target aarch64-linux-android || exit 1
41-
$UNIFFI_BINDGEN_BIN generate bindings/ldk_node.udl --lib-file "$TARGET_DIR"/x86_64-linux-android/release-smaller/libldk_node.so --language kotlin --config uniffi-android.toml -o "$BINDINGS_DIR"/"$PROJECT_DIR"/lib/src/main/kotlin || exit 1
38+
RUSTFLAGS="${RUSTFLAGS} -C link-args=-Wl,-z,max-page-size=16384,-z,common-page-size=16384" CFLAGS="-D__ANDROID_MIN_SDK_VERSION__=21" AR=llvm-ar CARGO_TARGET_X86_64_LINUX_ANDROID_LINKER="x86_64-linux-android21-clang" CC="x86_64-linux-android21-clang" cargo build --profile release-smaller --features uniffi --target x86_64-linux-android || exit 1
39+
RUSTFLAGS="${RUSTFLAGS} -C link-args=-Wl,-z,max-page-size=16384,-z,common-page-size=16384" CFLAGS="-D__ANDROID_MIN_SDK_VERSION__=21" AR=llvm-ar CARGO_TARGET_ARMV7_LINUX_ANDROIDEABI_LINKER="armv7a-linux-androideabi21-clang" CC="armv7a-linux-androideabi21-clang" cargo build --profile release-smaller --features uniffi --target armv7-linux-androideabi || exit 1
40+
RUSTFLAGS="${RUSTFLAGS} -C link-args=-Wl,-z,max-page-size=16384,-z,common-page-size=16384" CFLAGS="-D__ANDROID_MIN_SDK_VERSION__=21" AR=llvm-ar CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER="aarch64-linux-android21-clang" CC="aarch64-linux-android21-clang" cargo build --profile release-smaller --features uniffi --target aarch64-linux-android || exit 1
41+
RUSTFLAGS="${RUSTFLAGS}" $UNIFFI_BINDGEN_BIN generate bindings/ldk_node.udl --lib-file "$TARGET_DIR"/x86_64-linux-android/release-smaller/libldk_node.so --language kotlin --config uniffi-android.toml -o "$BINDINGS_DIR"/"$PROJECT_DIR"/lib/src/main/kotlin || exit 1
4242

4343
JNI_LIB_DIR="$BINDINGS_DIR"/"$PROJECT_DIR"/lib/src/main/jniLibs/
4444
mkdir -p $JNI_LIB_DIR/x86_64 || exit 1

0 commit comments

Comments
 (0)