All Projects β†’ ReactiveCircus β†’ Android Emulator Runner

ReactiveCircus / Android Emulator Runner

Licence: apache-2.0
A GitHub Action for installing, configuring and running hardware-accelerated Android Emulators on macOS virtual machines.

Programming Languages

javascript
184084 projects - #8 most used programming language

Labels

Projects that are alternatives of or similar to Android Emulator Runner

clusterfuzzlite
ClusterFuzzLite - Simple continuous fuzzing that runs in CI.
Stars: ✭ 315 (+7.14%)
Mutual labels:  ci
Travis Buddy
πŸš€ Seamless integration between TravisCI and GitHub
Stars: ✭ 262 (-10.88%)
Mutual labels:  ci
Baur
baur manages builds and artifacts in mono repositories
Stars: ✭ 285 (-3.06%)
Mutual labels:  ci
tichi
TiChi ☯️ contains the tidb community collaboration automation basic framework and tool set.
Stars: ✭ 36 (-87.76%)
Mutual labels:  ci
python-project-skeleton
An up-to-date and explanatory Python project skeleton with contiuous integration services.
Stars: ✭ 31 (-89.46%)
Mutual labels:  ci
Github Action Benchmark
GitHub Action for continuous benchmarking to keep performance
Stars: ✭ 264 (-10.2%)
Mutual labels:  ci
steps-google-play-deploy
No description or website provided.
Stars: ✭ 40 (-86.39%)
Mutual labels:  ci
Travis Watch
Stream live travis test results of the current commit to your terminal!
Stars: ✭ 294 (+0%)
Mutual labels:  ci
Unity Builder
Build Unity projects for different platforms
Stars: ✭ 258 (-12.24%)
Mutual labels:  ci
Nvwa Io
Nvwa-io is a open source DevOps CI/CD auto-build and auto-deploy system(ε₯³ε¨² - 开源 DevOps CI/CD θ‡ͺεŠ¨ζž„ε»Ίε’Œθ‡ͺεŠ¨ιƒ¨η½²η³»η»Ÿ). http://nvwa-io.com
Stars: ✭ 283 (-3.74%)
Mutual labels:  ci
build-status
Emacs minor mode that monitors and shows a buffer's build status in the mode line.
Stars: ✭ 26 (-91.16%)
Mutual labels:  ci
steps-install-missing-android-tools
No description or website provided.
Stars: ✭ 14 (-95.24%)
Mutual labels:  ci
Manaphp
ManaPHP Framework: Swoole+FPM
Stars: ✭ 271 (-7.82%)
Mutual labels:  ci
bx-docker
Tutorial on how to build Docker Images for the IAR Build Tools on Linux hosts. The IAR Build Tools on Linux are available for Arm, RISC-V and Renesas (RH850, RL78 and RX).
Stars: ✭ 28 (-90.48%)
Mutual labels:  ci
Pa11y Ci
Pa11y CI is a CI-centric accessibility test runner, built using Pa11y
Stars: ✭ 291 (-1.02%)
Mutual labels:  ci
Android-CICD
This repo demonstrates how to work on CI/CD for Mobile Apps πŸ“± using Github Actions πŸ’Š + Firebase Distribution πŸŽ‰
Stars: ✭ 37 (-87.41%)
Mutual labels:  ci
Lighthouse Action
πŸ’‘πŸ  GitHub Action for running @GoogleChromeLabs Lighthouse webpage audits
Stars: ✭ 263 (-10.54%)
Mutual labels:  ci
Awx Container
Ansible Container project that manages the lifecycle of AWX on Docker.
Stars: ✭ 294 (+0%)
Mutual labels:  ci
Terraform Aws Gitlab Runner
Terraform module for AWS GitLab runners on ec2 (spot) instances
Stars: ✭ 292 (-0.68%)
Mutual labels:  ci
Alloy ci
Continuous Integration, Deployment, and Delivery coordinator, written in Elixir.
Stars: ✭ 274 (-6.8%)
Mutual labels:  ci

GitHub Action - Android Emulator Runner

GitHub Actions status

A GitHub Action for installing, configuring and running hardware-accelerated Android Emulators on macOS virtual machines.

The old ARM-based emulators were slow and are no longer supported by Google. The modern Intel Atom (x86 and x86_64) emulators require hardware acceleration (HAXM on Mac & Windows, QEMU on Linux) from the host to run fast. This presents a challenge on CI as to be able to run hardware accelerated emulators within a docker container, KVM must be supported by the host VM which isn't the case for cloud-based CI providers due to infrastructural limits. If you want to learn more about this, here's an article I wrote: Running Android Instrumented Tests on CI.

The macOS VM provided by GitHub Actions has HAXM installed so we are able to create a new AVD instance, launch an emulator with hardware acceleration, and run our Android tests directly on the VM.

This action automates the process by doing the following:

  • Install / update the required Android SDK components including build-tools, platform-tools, platform (for the required API level), emulator and system-images (for the required API level).
  • Create a new instance of AVD with the provided configurations.
  • Launch a new Emulator with the provided configurations.
  • Wait until the Emulator is booted and ready for use.
  • Run a custom script provided by user once the Emulator is up and running - e.g. ./gradlew connectedCheck.
  • Kill the Emulator and finish the action.

Usage

It is recommended to run this action on a macOS VM, e.g. macos-latest or macos-10.15 to take advantage of hardware accleration support provided by HAXM.

A workflow that uses android-emulator-runner to run your instrumented tests on API 29:

jobs:
  test:
    runs-on: macos-latest
    steps:
    - name: checkout
      uses: actions/[email protected]

    - name: run tests
      uses: reactivecircus/[email protected]
      with:
        api-level: 29
        script: ./gradlew connectedCheck

We can also leverage GitHub Actions's build matrix to test across multiple configurations:

jobs:
  test:
    runs-on: macos-latest
    strategy:
      matrix:
        api-level: [21, 23, 29]
        target: [default, google_apis]
    steps:
    - name: checkout
      uses: actions/[email protected]

    - name: run tests
      uses: reactivecircus/[email protected]
      with:
        api-level: ${{ matrix.api-level }}
        target: ${{ matrix.target }}
        arch: x86_64
        profile: Nexus 6
        script: ./gradlew connectedCheck

If you need specific versions of NDK and CMake installed:

jobs:
  test:
    runs-on: macos-latest
    steps:
    - name: checkout
      uses: actions/[email protected]

    - name: run tests
      uses: reactivecircus/[email protected]
      with:
        api-level: 29
        ndk: 21.0.6113669
        cmake: 3.10.2.4988404
        script: ./gradlew connectedCheck

Configurations

Input Required Default Description
api-level Required N/A API level of the platform system image - e.g. 23 for Android Marshmallow, 29 for Android 10. Minimum API level supported is 15.
target Optional default Target of the system image - default, google_apis or playstore.
arch Optional x86 CPU architecture of the system image - x86 or x86_64. Note that x86_64 image is only available for API 21+.
profile Optional N/A Hardware profile used for creating the AVD - e.g. Nexus 6. For a list of all profiles available, run avdmanager list and refer to the results under "Available Android Virtual Devices".
cores Optional 2 Number of cores to use for the emulator (hw.cpu.ncore in config.ini).
sdcard-path-or-size Optional N/A Path to the SD card image for this AVD or the size of a new SD card image to create for this AVD, in KB or MB, denoted with K or M. - e.g. path/to/sdcard, or 1000M.
avd-name Optional test Custom AVD name used for creating the Android Virtual Device.
emulator-options Optional See below Command-line options used when launching the emulator (replacing all default options) - e.g. -no-window -no-snapshot -camera-back emulated.
disable-animations Optional true Whether to disable animations - true or false.
emulator-build Optional N/A Build number of a specific version of the emulator binary to use e.g. 6061023 for emulator v29.3.0.0.
working-directory Optional ./ A custom working directory - e.g. ./android if your root Gradle project is under the ./android sub-directory within your repository.
ndk Optional N/A Version of NDK to install - e.g. 21.0.6113669
cmake Optional N/A Version of CMake to install - e.g. 3.10.2.4988404
script Required N/A Custom script to run - e.g. to run Android instrumented tests on the emulator: ./gradlew connectedCheck

Default emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim.

Can I use this action on Linux VMs?

The short answer is yes but it's expected to be a much worse experience (on some newer API levels it might not work at all) than running it on macOS.

For a longer answer please refer to this issue.

Who is using Android Emulator Runner?

These are some of the open-source projects using (or used) Android Emulator Runner:

If you are using Android Emulator Runner and want your project included in the list, please feel free to create an issue or open a pull request.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].