Skip to content

Test Android SDK

Test Android SDK #24

name: Test Android SDK
on:
workflow_run:
workflows: ["Package FFI Engine"]
types: [completed]
permissions:
contents: write
id-token: write
jobs:
test:
name: Integration Tests
runs-on: ubuntu-latest
steps:
- name: Checkout Sources
uses: actions/checkout@v4
- name: Install Flipt
uses: flipt-io/[email protected]
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
with:
app_id: ${{ secrets.FLIPT_RELEASE_BOT_APP_ID }}
private_key: ${{ secrets.FLIPT_RELEASE_BOT_APP_PEM }}
installation_id: ${{ secrets.FLIPT_RELEASE_BOT_INSTALLATION_ID }}
- name: Download Artifact (x86_64)
uses: actions/download-artifact@v4
with:
github-token: ${{ steps.generate_token.outputs.token }}
name: flipt-engine-ffi-Android-x86_64.tar.gz
path: flipt-engine-ffi-Android-x86_64.tar.gz
- name: Download Artifact (arm64)
uses: actions/download-artifact@v4
with:
github-token: ${{ steps.generate_token.outputs.token }}
name: flipt-engine-ffi-Android-arm64.tar.gz
path: flipt-engine-ffi-Android-arm64.tar.gz
- name: Extract Artifacts
run: |
tar -xzvf flipt-engine-ffi-Android-x86_64.tar.gz -C ./flipt-engine-ffi-Android-x86_64
tar -xzvf flipt-engine-ffi-Android-arm64.tar.gz -C ./flipt-engine-ffi-Android-arm64
ls -la ./flipt-engine-ffi-Android-x86_64
ls -la ./flipt-engine-ffi-Android-arm64
# - name: Run flipt
# env:
# FLIPT_STORAGE_TYPE: "local"
# FLIPT_STORAGE_LOCAL_PATH: "./test/fixtures/testdata"
# run: flipt&
# - name: Install System Image
# run: |
# echo "Installing system image..."
# sdkmanager "system-images;android-33;google_apis;x86_64"
# - name: Create Emulator
# run: |
# echo "Creating emulator..."
# echo "no" | avdmanager create avd -n test -k "system-images;android-33;google_apis;x86_64" --device "pixel"
# - name: Start Emulator
# run: |
# echo "Starting emulator..."
# $ANDROID_HOME/emulator/emulator -avd test -no-audio -no-boot-anim -no-window -gpu swiftshader_indirect &
# - name: Wait for Emulator to Boot
# run: |
# echo "Waiting for emulator to boot..."
# adb wait-for-device
# adb shell getprop init.svc.bootanim | grep -m 1 stopped
# - name: Run Integration Tests
# env:
# FLIPT_URL: "http://0.0.0.0:8080"
# FLIPT_AUTH_TOKEN: "secret"
# run: |
# cd ./flipt-client-kotlin-android
# ./gradlew connectedAndroidTest
# - name: Stop Emulator
# if: always()
# run: |
# echo "Stopping emulator..."
# adb emu kill