ReactiveCircus / android-emulator-runner

A GitHub Action for installing, configuring and running hardware-accelerated Android Emulators on macOS virtual machines.
Apache License 2.0
977 stars 193 forks source link

Automatically support KVM on Linux #370

Open TWiStErRob opened 10 months ago

TWiStErRob commented 10 months ago

Following this announcement: https://github.blog/2024-01-17-github-hosted-runners-double-the-power-for-open-source/

It is now possible to enable KVM on ubuntu-latest: https://twitter.com/colinwhi/status/1749236103956291857

From some empirical non-scientific testing*: mac boot: 1 min 23 seconds linux boot (without hardware virtualization): 2 min 23 seconds linux kvm boot: 15 seconds

* boot = from emulator -avd command to adb shell getprop sys.boot_completed returning 1.

One of my UI test suite (small) went from 12 minutes to 6 minutes via this change. Note that most of this must be down to the Gradle build. I'm yet to try this on a bigger project which is more emulator-heavy.

TWiStErRob commented 10 months ago

On a heavy emulator CI it went from 27 minutes to 17 minutes.

TWiStErRob commented 10 months ago

Oh, I just saw https://github.com/ReactiveCircus/android-emulator-runner/pull/366, so you're aware. Can it be incorporated into the action so not every user has to do it?

ychescale9 commented 10 months ago

I did a quick test but it didn't seem to take effect when running those commands from the action itself. I can make another attempt later unless you want to give it a go?

TWiStErRob commented 10 months ago

I'll let you, you know your way around VMs way more, so you can diagnose easier.

Happy to review and maybe help, if you get stuck. Tag me on a PR.