From 0e8ea843b792676fb46e2a140291f43fba2bd3dd Mon Sep 17 00:00:00 2001 From: Amod Malviya Date: Tue, 5 Mar 2024 23:11:43 +0530 Subject: [PATCH] android: move target api level of tests to 33 #build-android --- .github/workflows/android.yaml | 23 ++++++++--------------- tests/test-android-app/Cargo.toml | 3 +++ 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/.github/workflows/android.yaml b/.github/workflows/android.yaml index a3389a6..d33b163 100644 --- a/.github/workflows/android.yaml +++ b/.github/workflows/android.yaml @@ -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' }} @@ -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 @@ -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 diff --git a/tests/test-android-app/Cargo.toml b/tests/test-android-app/Cargo.toml index 150a288..3bce8fb 100644 --- a/tests/test-android-app/Cargo.toml +++ b/tests/test-android-app/Cargo.toml @@ -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