Skip to content

Commit

Permalink
try android-emulator-runner
Browse files Browse the repository at this point in the history
Signed-off-by: Roman Dmytrenko <[email protected]>
  • Loading branch information
erka committed Jan 8, 2025
1 parent 6a54fce commit fd7c09a
Showing 1 changed file with 13 additions and 30 deletions.
43 changes: 13 additions & 30 deletions .github/workflows/test-android-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ jobs:
name: Integration Tests
runs-on: ubuntu-latest
steps:
- name: Enable KVM group perms
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Checkout Sources
uses: actions/checkout@v4

Expand All @@ -23,21 +28,6 @@ jobs:
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: "17"
distribution: "temurin"

- name: Setup Android SDK
uses: android-actions/setup-android@v3
with:
api-level: 33
target: default
arch: x86_64
profile: default
emulator-build: stable

- name: Generate token
id: generate_token
uses: tibdex/github-app-token@v2
Expand Down Expand Up @@ -84,25 +74,18 @@ jobs:
FLIPT_STORAGE_LOCAL_PATH: "./test/fixtures/testdata"
run: flipt&

- name: Install System Image
run: |
echo "Installing system image..."
echo "yes" | sdkmanager "platform-tools" "platforms;android-33" "emulator" "system-images;android-33;default;x86_64"
echo "Creating emulator..."
echo "no" | avdmanager create avd -n test -k "system-images;android-33;default;x86_64"
echo "Starting emulator..."
$ANDROID_HOME/emulator/emulator -avd test -no-window -no-snapshot -screen no-touch -noaudio -memory 2048 -no-boot-anim -accel off -camera-back none -gpu off &
echo "Waiting for emulator to boot..."
adb wait-for-device
adb shell getprop sys.boot_completed
- name: Run Integration Tests
uses: reactivecircus/android-emulator-runner@v2
env:
FLIPT_URL: "http://0.0.0.0:8080"
FLIPT_AUTH_TOKEN: "secret"
run: |
cd ./flipt-client-kotlin-android
./gradlew connectedAndroidTest
with:
api-level: 33
target: default
arch: x86_64
script: ./gradlew connectedAndroidTest
working-directory: ./flipt-client-kotlin-android
emulator-options: -no-window -no-snapshot -screen no-touch -noaudio -no-boot-anim -camera-back none

- name: Stop Emulator
if: always()
Expand Down

0 comments on commit fd7c09a

Please sign in to comment.