android: add initial ci

Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin
2025-06-17 12:58:12 -07:00
parent c8e861812b
commit 012ff9d53d
2 changed files with 23 additions and 1 deletions

View File

@@ -22,6 +22,28 @@ jobs:
cargo fmt --all -- --check cargo fmt --all -- --check
cargo clippy cargo clippy
android:
name: Check (android)
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt,clippy
- name: Setup Java JDK
uses: actions/setup-java@v4.5.0
with:
java-version: '17'
distribution: 'temurin'
- name: Setup Android SDK
uses: android-actions/setup-android@v3
- name: Add android rust target
run: rustup target add aarch64-linux-android
- name: Install Cargo NDK
run: cargo install cargo-ndk
- name: Run tests
run: make jni-check
linux-test: linux-test:
name: Test (Linux) name: Test (Linux)
uses: ./.github/workflows/build-and-test.yml uses: ./.github/workflows/build-and-test.yml

View File

@@ -13,7 +13,7 @@ jni: fake
cargo ndk --target arm64-v8a -o $(ANDROID_DIR)/app/src/main/jniLibs/ build --profile release cargo ndk --target arm64-v8a -o $(ANDROID_DIR)/app/src/main/jniLibs/ build --profile release
jni-check: fake jni-check: fake
cargo ndk --target arm64-v8a -o $(ANDROID_DIR)/app/src/main/jniLibs/ check cargo ndk --target arm64-v8a check
apk: jni apk: jni
cd $(ANDROID_DIR) && ./gradlew build cd $(ANDROID_DIR) && ./gradlew build