Blog post

Hardware accelerated Android Emulator on BuildJet for GitHub Actions

7/20/2022

2 minute read
Adam ShiervaniCo-Founder

Today, we’re delighted to introduce support for hardware accelerated Android emulators on all BuildJet runners, by adding VM in VM support. This allows Android developers to create fast and affordable runners for their CI workloads. BuildJet for GitHub Actions runs Android Emulator tests 20x cheaper and 2.5x faster than what is currently possible on GitHub Actions.

Many Android developers enjoy GitHub Actions, its great integration with GitHub and ease of use. However, running tests that need to emulate Android, are extremely slow on GitHub Action’s Ubuntu runners. This is due to GitHub Actions and most other CIs don't allow nested VMs(a VM in a VM), which prevent us from running hardware accelerated emulators.

To work around this on GitHub Actions, Android developers have resorted to using the macOS runners that have HAXM enabled, which enables VM in VM therefore allowing Android Emulators with hardware acceleration. The issue with running tests with GitHub Action's macOS runner is that it’s extremely slow and very expensive.

#

20x cheaper and 2.5x faster

In our testing, we found that BuildJet for GitHub Actions finished the tests 2.5x faster than GitHub Actions running their macos-latest runner. Additionally, GitHub Actions is 20 times as expensive as our base runner, which is the one we used to run the benchmark with.

Our 2vCPU runner costs $0.004/min, compared to GitHub Actions $0.08/min for their macOS runner.

For the test, we used one of the most popular Android Libraries, Retrofit. They have a test suite that they run on GitHub Actions macos-latest runner using a commonly used Action, ReactiveCircus/android-emulator-runner to set up and run their Android Emulator test.

GitHub Actions macOS runner compared to the BuildJet 2vCPU runner and the GitHub Action 2vCPU Ubuntu runner Check out the benchmark workflow run here for more details.

If this sounds interesting and you'd like to use BuildJet for GitHub Actions, simply authorize BuildJet on the repositories you want to use and then update the runs-on property in your workflow.yml.

yaml
1
runs-on: buildjet-2vcpu-ubuntu-2204

For more information, please check out our documentation.

Existing customers that would like to take advantage of the faster Android Emulator tests, don’t have to do anything, as we submitted and merged fixes to ReactiveCircus/android-emulator-runner to properly work with BuildJet.

Lastly, we'd like to thank Yang C for this development on the android-emulator-runner action, and his quick merges. Thanks for your support!

Happy building!

Buildjet CI Logo
Make Github Actions Faster
Change 1 line, get 2x faster and cheaper builds

© 2024 BuildJet, Inc. - All rights reserved.

BuildJet has no affiliation with GitHub, Inc. or any of its parent or subsidiary companies and/or affiliates.