diff --git a/README.md b/README.md index 50f3db78..dcadfa08 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ A GitHub Action for installing, configuring and running hardware-accelerated And 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](https://dev.to/ychescale9/running-android-emulators-on-ci-from-bitrise-io-to-github-actions-3j76). -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 +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: @@ -90,7 +90,7 @@ jobs: |-|-|-|-| | `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+. | +| `arch` | Optional | `x86` | CPU architecture of the system image - `x86`, `x86_64` or `arm64-v8a`. Note that `x86_64` image is only available for API 21+. `arm64-v8a` images require Android 4.2+ and are limited to fewer API levels (e.g. 30). | | `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`. | diff --git a/action.yml b/action.yml index c3e3c892..fb8f87b8 100644 --- a/action.yml +++ b/action.yml @@ -2,7 +2,7 @@ name: 'Android Emulator Runner' description: 'Installs, configures and starts an Android Emulator directly on macOS virtual machines.' author: 'Reactive Circus' branding: - icon: 'smartphone' + icon: 'smartphone' color: 'green' inputs: api-level: @@ -12,7 +12,7 @@ inputs: description: 'target of the system image - default, google_apis or playstore' default: 'default' arch: - description: 'CPU architecture of the system image - x86 or x86_64' + description: 'CPU architecture of the system image - x86, x86_64 or arm64-v8a' default: 'x86' profile: description: 'hardware profile used for creating the AVD - e.g. `Nexus 6`' @@ -30,7 +30,7 @@ inputs: disable-animations: description: 'whether to disable animations - true or false' default: 'true' - disable-spellchecker: + disable-spellchecker: description: Whether to disable spellchecker - `true` or `false`. default: 'false' emulator-build: diff --git a/lib/input-validator.js b/lib/input-validator.js index b4ff8bf3..3c6f9dfd 100644 --- a/lib/input-validator.js +++ b/lib/input-validator.js @@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.checkEmulatorBuild = exports.checkDisableSpellchecker = exports.checkDisableAnimations = exports.checkArch = exports.checkTarget = exports.checkApiLevel = exports.VALID_ARCHS = exports.VALID_TARGETS = exports.MIN_API_LEVEL = void 0; exports.MIN_API_LEVEL = 15; exports.VALID_TARGETS = ['default', 'google_apis', 'google_apis_playstore']; -exports.VALID_ARCHS = ['x86', 'x86_64']; +exports.VALID_ARCHS = ['x86', 'x86_64', 'arm64-v8a']; function checkApiLevel(apiLevel) { if (isNaN(Number(apiLevel)) || !Number.isInteger(Number(apiLevel))) { throw new Error(`Unexpected API level: '${apiLevel}'.`); diff --git a/src/input-validator.ts b/src/input-validator.ts index c419dfed..edf3006c 100644 --- a/src/input-validator.ts +++ b/src/input-validator.ts @@ -1,6 +1,6 @@ export const MIN_API_LEVEL = 15; export const VALID_TARGETS: Array = ['default', 'google_apis', 'google_apis_playstore']; -export const VALID_ARCHS: Array = ['x86', 'x86_64']; +export const VALID_ARCHS: Array = ['x86', 'x86_64', 'arm64-v8a']; export function checkApiLevel(apiLevel: string): void { if (isNaN(Number(apiLevel)) || !Number.isInteger(Number(apiLevel))) {