Skip to content

Commit

Permalink
android: move target api level of tests to 33 #build-android
Browse files Browse the repository at this point in the history
  • Loading branch information
amodm committed Mar 5, 2024
1 parent b88c138 commit 0e8ea84
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
23 changes: 8 additions & 15 deletions .github/workflows/android.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
strategy:
matrix:
rust: [ stable ]
api-level: [ 30 ]
api-level: [ 33 ]
ndk-version: [ '25.1.8937393' ]
cmake-version: [ '3.22.1' ]
continue-on-error: ${{ matrix.rust != 'stable' && matrix.rust != 'beta' }}
Expand All @@ -46,6 +46,13 @@ jobs:
if: steps.cargo-apk-cache.outputs.cache-hit != 'true'
run: cargo install cargo-apk --version ${{ env.CARGO_APK_VERSION }}

# Pre-build
- name: Compile
run: rustup run ${{ matrix.rust }} cargo apk build --target ${{ env.ANDROID_TARGET }}
working-directory: tests/test-android-app
- name: Compile tests
run: rustup run ${{ matrix.rust }} cargo build --test test_android

# Check if AVD is in cache, else create AVD
- name: AVD cache
uses: actions/cache@v3
Expand All @@ -66,20 +73,6 @@ jobs:
disable-animations: false
script: echo "Generated AVD snapshot for caching."

# Compile test app
- name: Compile
uses: reactivecircus/android-emulator-runner@v2
with:
arch: ${{ env.ANDROID_ARCH }}
api-level: ${{ matrix.api-level }}
ndk: ${{ matrix.ndk-version }}
cmake: ${{ matrix.cmake-version }}
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
working-directory: tests/test-android-app
script: bash -c 'ANDROID_TARGET=${{ env.ANDROID_TARGET }} ANDROID_NDK_ROOT=$ANDROID_SDK_ROOT/ndk/${{ matrix.ndk-version }} rustup run ${{ matrix.rust }} cargo apk build --target ${{ env.ANDROID_TARGET }}'

# Run tests on emulator
- name: Run tests
uses: reactivecircus/android-emulator-runner@v2
Expand Down
3 changes: 3 additions & 0 deletions tests/test-android-app/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ crate-type = ["lib", "cdylib"]
jni = "0.19"
ndk-glue = "0.7"
webbrowser = { path = "../.." }

[package.metadata.android.sdk]
target_sdk_version = 33

0 comments on commit 0e8ea84

Please sign in to comment.