From 50ecc3a480033e622ddd1dc0d9a107f2c1e03478 Mon Sep 17 00:00:00 2001 From: kishorekumar-anchala <168699259+kishorekumar-anchala@users.noreply.github.com> Date: Fri, 13 Dec 2024 20:39:43 +0530 Subject: [PATCH] Create test-em.yml --- .github/workflows/test-em.yml | 46 +++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/test-em.yml diff --git a/.github/workflows/test-em.yml b/.github/workflows/test-em.yml new file mode 100644 index 000000000..95fb0c0f1 --- /dev/null +++ b/.github/workflows/test-em.yml @@ -0,0 +1,46 @@ +name: "Check Android SDK and Emulator Installation" +on: + workflow_dispatch: + push: + branches: + - main + +jobs: + check_android_sdk: + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Set up environment variables + run: | + echo "ANDROID_SDK_ROOT=/usr/local/lib/android/sdk" >> $GITHUB_ENV + echo "ANDROID_HOME=/usr/local/lib/android/sdk" >> $GITHUB_ENV + + - name: Install SDK Tools + run: | + sudo apt-get update + sudo apt-get install -y wget unzip + wget https://dl.google.com/android/repository/commandlinetools-linux-8512546_latest.zip -O cmdline-tools.zip + unzip cmdline-tools.zip -d $ANDROID_HOME/cmdline-tools + mv $ANDROID_HOME/cmdline-tools/cmdline-tools $ANDROID_HOME/cmdline-tools/latest + + - name: Install Android Emulator + run: | + yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --sdk_root=$ANDROID_HOME --install "emulator" + + - name: Verify Installation + run: | + echo "Checking if Android SDK and Emulator are installed..." + if [ -d "$ANDROID_SDK_ROOT" ]; then + echo "Android SDK is installed at $ANDROID_SDK_ROOT" + else + echo "Android SDK is not installed" + fi + + emulator_path="$ANDROID_HOME/emulator/emulator" + if [ -f "$emulator_path" ]; then + echo "Android Emulator is installed at $emulator_path" + else + echo "Android Emulator is not installed" + fi