Skip to content

Commit d1149a3

Browse files
committed
Fix github action
1 parent c7e14c6 commit d1149a3

File tree

1 file changed

+11
-28
lines changed

1 file changed

+11
-28
lines changed
Lines changed: 11 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Android Workflow
1+
name: Test
22

33
on: [push, pull_request]
44

@@ -16,11 +16,11 @@ jobs:
1616
- name: Checkout code
1717
uses: actions/checkout@v3
1818

19-
- name: Set up JDK 17
19+
- name: Set up JDK 11
2020
uses: actions/setup-java@v3
2121
with:
22-
distribution: 'temurin'
23-
java-version: '17'
22+
distribution: 'adopt'
23+
java-version: '11'
2424

2525
- name: Setup Android SDK
2626
uses: android-actions/setup-android@v2
@@ -30,11 +30,12 @@ jobs:
3030
cd $ANDROID_HOME/cmdline-tools/latest/bin
3131
./sdkmanager "platform-tools"
3232
./sdkmanager "emulator"
33+
./sdkmanager "tools"
3334
./sdkmanager "build-tools;${ANDROID_BUILD_TOOLS_VERSION}"
3435
./sdkmanager "platforms;android-${TARGET_VERSION}"
35-
./sdkmanager "system-images;android-30;google_apis;x86_64"
36+
./sdkmanager "system-images;android-30;google_apis;x86"
3637
37-
- name: Enable KVM (safe for CI even if no hardware accel)
38+
- name: Enable KVM
3839
run: |
3940
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
4041
sudo udevadm control --reload-rules
@@ -43,7 +44,7 @@ jobs:
4344
- name: Create AVD
4445
run: |
4546
cd $ANDROID_HOME/cmdline-tools/latest/bin
46-
echo no | ./avdmanager create avd -n test -k "system-images;android-30;google_apis;x86_64" --force
47+
echo no | ./avdmanager create avd -n test -k "system-images;android-30;google_apis;x86" --force
4748
4849
- name: Start ADB Server
4950
run: adb start-server
@@ -52,23 +53,9 @@ jobs:
5253
run: |
5354
echo "Starting emulator..."
5455
export PATH=$PATH:$ANDROID_HOME/emulator
55-
nohup emulator -avd test -no-audio -no-window -no-boot-anim -no-metrics -accel off > /tmp/emulator.log 2>&1 &
56-
57-
echo "Waiting for emulator device..."
58-
adb wait-for-device
59-
60-
echo "Waiting for emulator to boot..."
61-
boot_completed=""
62-
until [[ "$boot_completed" == "1" ]]; do
63-
sleep 5
64-
boot_completed=$(adb shell getprop sys.boot_completed 2>/dev/null | tr -d '\r')
65-
done
66-
67-
adb shell input keyevent 82
68-
echo "Emulator is fully booted."
69-
70-
- name: Verify emulator is running
71-
run: adb devices
56+
emulator -avd test -no-audio -no-window -no-boot-anim -no-metrics &
57+
# Wait for the emulator to start up
58+
sleep 120
7259
7360
- name: Export CLOUDINARY_URL
7461
run: |
@@ -77,7 +64,3 @@ jobs:
7764
7865
- name: Run tests
7966
run: ./gradlew clean connectedCheck --stacktrace
80-
81-
- name: Dump emulator log on failure
82-
if: failure()
83-
run: cat /tmp/emulator.log

0 commit comments

Comments
 (0)