Skip to content

Commit 313c1bb

Browse files
ci: run android emulator tests in ci
1 parent e4f4124 commit 313c1bb

File tree

1 file changed

+36
-21
lines changed

1 file changed

+36
-21
lines changed

.github/workflows/test-android.yaml

Lines changed: 36 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,46 +10,61 @@ on:
1010
- "bdk-ffi/**"
1111
- "bdk-android/**"
1212

13-
# The default Android NDK on the ubuntu-24.04 image is 25.2.9519653
14-
1513
permissions: {}
1614

1715
jobs:
1816
build:
1917
runs-on: ubuntu-24.04
2018
steps:
21-
- name: "Show default version of NDK"
22-
run: echo $ANDROID_NDK_ROOT
23-
2419
- name: "Check out PR branch"
2520
uses: actions/checkout@v4
2621
with:
2722
persist-credentials: false
2823

29-
- name: "Cache"
30-
uses: actions/cache@v3
31-
with:
32-
path: |
33-
~/.cargo/registry
34-
~/.cargo/git
35-
./target
36-
key: ${{ runner.os }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
37-
3824
- name: "Set up JDK"
3925
uses: actions/setup-java@v4
4026
with:
4127
distribution: temurin
4228
java-version: 17
4329

30+
- name: "Setup Android SDK"
31+
uses: android-actions/setup-android@v3
32+
33+
- name: "Setup Android NDK"
34+
uses: nttld/setup-ndk@v1
35+
with:
36+
ndk-version: r26c
37+
38+
- name: "Install Rust"
39+
uses: dtolnay/rust-toolchain@stable
40+
with:
41+
toolchain: 1.84.1
42+
43+
- name: "Cache Rust"
44+
uses: actions/cache@v4
45+
with:
46+
path: |
47+
~/.cargo/registry
48+
~/.cargo/git
49+
./target
50+
key: ${{ runner.os }}-rust-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
51+
4452
- name: "Build Android library"
4553
run: |
4654
cd bdk-android
4755
bash ./scripts/build-linux-x86_64.sh
4856
49-
# There are currently no unit tests for bdk-android (see the tests in bdk-jvm instead) and the
50-
# integration tests require the macOS image which is not working with the older NDK version we
51-
# are using, so for now we just make sure that the library builds and omit the connectedTest
52-
# - name: "Run Android connected tests"
53-
# run: |
54-
# cd bdk-android
55-
# ./gradlew connectedAndroidTest --console=plain
57+
- name: Enable KVM
58+
run: |
59+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
60+
sudo udevadm control --reload-rules
61+
sudo udevadm trigger --name-match=kvm
62+
63+
- name: "Run Android connected tests"
64+
uses: reactivecircus/android-emulator-runner@v2
65+
with:
66+
api-level: 30
67+
target: google_apis
68+
arch: x86_64
69+
profile: Nexus 6
70+
script: cd bdk-android && ./gradlew connectedAndroidTest --console=plain

0 commit comments

Comments
 (0)