Skip to content

Commit 992e997

Browse files
committed
ci: use CARGO_NDK_TARGET env var instead of repeating --target
cargo-ndk reads CARGO_NDK_TARGET when --target is not passed on the command line. Setting it once at the job level shortens every test invocation and lets the rust-toolchain action share the same value.
1 parent 39ae911 commit 992e997

2 files changed

Lines changed: 15 additions & 12 deletions

File tree

.github/workflows/ci.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ jobs:
143143
timeout-minutes: 60
144144
runs-on: ubuntu-latest
145145
env:
146-
ANDROID_TARGET: x86_64-linux-android
146+
CARGO_NDK_TARGET: x86_64-linux-android
147147
strategy:
148148
fail-fast: false
149149
matrix:
@@ -162,7 +162,7 @@ jobs:
162162
- name: Set up Rust
163163
uses: dtolnay/rust-toolchain@stable
164164
with:
165-
target: ${{ env.ANDROID_TARGET }}
165+
target: ${{ env.CARGO_NDK_TARGET }}
166166

167167
- name: Setup Java
168168
uses: actions/setup-java@v5
@@ -187,15 +187,15 @@ jobs:
187187
# Build all the test binaries up front so the emulator boot can
188188
# overlap with compilation. cargo-ndk runs `cargo test --no-run`
189189
# against each crate; the binaries land in
190-
# target/$ANDROID_TARGET/debug/deps/.
190+
# target/$CARGO_NDK_TARGET/debug/deps/.
191191
- name: Build workspace test binaries
192192
env:
193193
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
194194
run: |
195-
cargo ndk --target "$ANDROID_TARGET" test --no-run -p iroh-base --all-features
196-
cargo ndk --target "$ANDROID_TARGET" test --no-run -p iroh-dns --features tls-ring
197-
cargo ndk --target "$ANDROID_TARGET" test --no-run -p iroh-relay --features tls-ring,metrics
198-
cargo ndk --target "$ANDROID_TARGET" test --no-run -p iroh --features tls-ring,metrics,portmapper,test-utils
195+
cargo ndk test --no-run -p iroh-base --all-features
196+
cargo ndk test --no-run -p iroh-dns --features tls-ring
197+
cargo ndk test --no-run -p iroh-relay --features tls-ring,metrics
198+
cargo ndk test --no-run -p iroh --features tls-ring,metrics,portmapper,test-utils
199199
200200
- name: Run workspace tests on Android emulator
201201
uses: reactivecircus/android-emulator-runner@v2
@@ -213,10 +213,10 @@ jobs:
213213
script: |
214214
adb wait-for-device
215215
adb shell 'i=0; while [ -z "$(getprop sys.boot_completed | tr -d "\r")" ]; do i=$((i+1)); if [ $i -gt 300 ]; then echo "boot did not complete within 600s"; exit 1; fi; sleep 2; done'
216-
cargo ndk --target "$ANDROID_TARGET" test -p iroh-base --all-features
217-
cargo ndk --target "$ANDROID_TARGET" test -p iroh-dns --features tls-ring
218-
cargo ndk --target "$ANDROID_TARGET" test -p iroh-relay --features tls-ring,metrics
219-
cargo ndk --target "$ANDROID_TARGET" test -p iroh --features tls-ring,metrics,portmapper,test-utils
216+
cargo ndk test -p iroh-base --all-features
217+
cargo ndk test -p iroh-dns --features tls-ring
218+
cargo ndk test -p iroh-relay --features tls-ring,metrics
219+
cargo ndk test -p iroh --features tls-ring,metrics,portmapper,test-utils
220220
221221
cross_test:
222222
name: Cross Test

iroh-dns/tests/integration.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ async fn resolver_constructs_without_panic() {
2121
// "no connections available" within ~30 ms, well before the 8s
2222
// per-lookup timeout, so a resolution that works locally fails in
2323
// CI. Tracking the actual fix separately; see Frando/android-dns-fix.
24-
#[cfg_attr(target_os = "android", ignore = "flaky on emulator (no connections available)")]
24+
#[cfg_attr(
25+
target_os = "android",
26+
ignore = "flaky on emulator (no connections available)"
27+
)]
2528
#[tokio::test]
2629
async fn resolver_resolves_dns_iroh_link() {
2730
let resolver = DnsResolver::new();

0 commit comments

Comments
 (0)