Skip to content

Commit

Permalink
Update Android CI workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
zHd4 committed Nov 19, 2024
1 parent 912bc8e commit 1c46093
Showing 1 changed file with 32 additions and 18 deletions.
50 changes: 32 additions & 18 deletions .github/workflows/android_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,44 @@ name: Android CI

on:
push:
branches: [ "master" ]
branches:
- main
pull_request:
branches: [ "master" ]

jobs:
build:
runs-on: macos-14
connectedTests:
name: Run Android Instrumented Tests
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: set up JDK 17
- name: Checkout Repository
uses: actions/checkout@v3

- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: gradle

- name: Grant execute permission for gradlew
run: chmod +x gradlew
distribution: 'zulu'
java-version: '11'

- name: Run connected tests
uses: ReactiveCircus/android-emulator-runner@v2
- name: Set up Android SDK
uses: android-actions/setup-android@v2
with:
api-level: 34
target: google_apis
arch: x86_64
script: ./gradlew connectedCheck
api-level: 31
build-tools: '31.0.0'
ndk: '21.4.7075529'

- name: Accept Licenses
run: |
yes | sdkmanager --licenses
- name: Create and Start Emulator
run: |
avdmanager create avd -n test -k "system-images;android-31;google_apis;x86_64" --device "pixel"
nohup emulator -avd test -no-window -no-audio -no-boot-anim &
adb wait-for-device
adb shell input keyevent 82
env:
DISPLAY: ":0"

- name: Run Instrumented Tests
run: ./gradlew connectedAndroidTest

0 comments on commit 1c46093

Please sign in to comment.