Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create em-test.yml #1

Merged
merged 1 commit into from
Dec 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions em-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: "Check Android SDK and Emulator Installation"
on:
workflow_dispatch:
push:
branches:
- test

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
Loading