Skip to content

Commit 07b0366

Browse files
committed
Merge branch 'main' into release/v2
* main: Prepare for release 2.12.0. Add support for using google_apis_playstore system images. Fix README.md typo
2 parents c56210b + 15da0b2 commit 07b0366

File tree

164 files changed

+2110
-8037
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

164 files changed

+2110
-8037
lines changed

.github/workflows/workflow.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ jobs:
3333
- os: macos-latest
3434
api-level: 30
3535
target: google_apis
36+
- os: macos-latest
37+
api-level: 24
38+
target: playstore
39+
3640
steps:
3741
- name: checkout
3842
uses: actions/checkout@v2

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# Change Log
22

3+
## v2.12.0
4+
5+
Added support for using the `playstore` system images:
6+
7+
```
8+
- name: run tests
9+
uses: reactivecircus/android-emulator-runner@v2
10+
with:
11+
api-level: 30
12+
target: playstore
13+
arch: x86
14+
script: ./gradlew connectedCheck
15+
```
16+
317
## v2.11.1
418

519
* Update SDK command-line tools to `2.1`.

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ A GitHub Action for installing, configuring and running hardware-accelerated And
88

99
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).
1010

11-
The **masOS** 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
11+
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
1212
tests directly on the VM.
1313

1414
This action automates the process by doing the following:
@@ -86,10 +86,10 @@ jobs:
8686

8787
## Configurations
8888

89-
| | **Required** | **Default** | **Description** |
90-
|----------------------|--------------|-------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
89+
| **Input** | **Required** | **Default** | **Description** |
90+
|-|-|-|-|
9191
| `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**. |
92-
| `target` | Optional | `default` | Target of the system image - `default` or `google_apis`. |
92+
| `target` | Optional | `default` | Target of the system image - `default`, `google_apis` or `playstore`. |
9393
| `arch` | Optional | `x86` | CPU architecture of the system image - `x86` or `x86_64`. Note that `x86_64` image is only available for API 21+. |
9494
| `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". |
9595
| `avd-name` | Optional | `test` | Custom AVD name used for creating the Android Virtual Device. |

__tests__/input-validator.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ describe('target validator tests', () => {
5353
validator.checkTarget('google_apis');
5454
};
5555
expect(func2).not.toThrow();
56+
57+
const func3 = () => {
58+
validator.checkTarget('google_apis');
59+
};
60+
expect(func3).not.toThrow();
5661
});
5762
});
5863

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ inputs:
99
description: 'API level of the platform and system image - e.g. 23 for Android Marshmallow, 29 for Android 10'
1010
required: true
1111
target:
12-
description: 'target of the system image - default or google_apis'
12+
description: 'target of the system image - default, google_apis or playstore'
1313
default: 'default'
1414
arch:
1515
description: 'CPU architecture of the system image - x86 or x86_64'

lib/input-validator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Object.defineProperty(exports, "__esModule", { value: true });
33
exports.checkEmulatorBuild = exports.checkDisableAnimations = exports.checkArch = exports.checkTarget = exports.checkApiLevel = exports.VALID_ARCHS = exports.VALID_TARGETS = exports.MIN_API_LEVEL = void 0;
44
exports.MIN_API_LEVEL = 15;
5-
exports.VALID_TARGETS = ['default', 'google_apis'];
5+
exports.VALID_TARGETS = ['default', 'google_apis', 'google_apis_playstore'];
66
exports.VALID_ARCHS = ['x86', 'x86_64'];
77
function checkApiLevel(apiLevel) {
88
if (isNaN(Number(apiLevel)) || !Number.isInteger(Number(apiLevel))) {

lib/main.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ function run() {
5252
const apiLevel = Number(apiLevelInput);
5353
console.log(`API level: ${apiLevel}`);
5454
// target of the system image
55-
const target = core.getInput('target');
55+
const targetInput = core.getInput('target');
56+
const target = targetInput == 'playstore' ? 'google_apis_playstore' : targetInput;
5657
input_validator_1.checkTarget(target);
5758
console.log(`target: ${target}`);
5859
// CPU architecture of the system image

node_modules/@actions/core/LICENSE.md

Lines changed: 8 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/@actions/core/README.md

Lines changed: 147 additions & 81 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/@actions/core/lib/command.d.ts

Lines changed: 16 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)