Skip to content

ci: run android tests in emulator on ci #489

ci: run android tests in emulator on ci

ci: run android tests in emulator on ci #489

Workflow file for this run

name: Test Android
on:
workflow_dispatch:
push:
paths:
- "bdk-ffi/**"
- "bdk-android/**"
pull_request:
paths:
- "bdk-ffi/**"
- "bdk-android/**"
# The default Android NDK on the macos-12 image is 25.2.9519653
jobs:
build:
runs-on: macos-12
steps:
- name: "Show default version of NDK"
run: echo $ANDROID_NDK_ROOT
- name: "Check out PR branch"
uses: actions/checkout@v3
- name: "Cache"
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
./target
key: ${{ runner.os }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
- name: "Set up JDK"
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 11
- name: "Set default Rust version to 1.73.0"
run: rustup default 1.73.0
- name: "Install Rust Android targets"
run: rustup target add x86_64-linux-android aarch64-linux-android armv7-linux-androideabi
- name: "Build Android library"
run: |
cd bdk-android
./gradlew buildAndroidLib --console=plain
- name: "Run connected tests"
uses: ReactiveCircus/android-emulator-runner@v2
with:
api-level: 31
target: google_apis
arch: x86_64
script: cd ./bdk-android/ && ./gradlew connectedAndroidTest --console=plain -P excludeConnectedTests