Skip to content

Commit e790971

Browse files
committed
Merge branch 'main' into release/v2
* main: Prepare for release 2.24.0. Add option to specify AVD heap size (#245) Gradle 7.4.2. Bump GH actions (#240) Bump minimist from 1.2.5 to 1.2.6 (#237) Update dependencies in test-fixture. Add more .gitignore rules (#231) Update README for using with gradle/gradle-build-action (#230)
2 parents 76c2bf6 + f30ff06 commit e790971

File tree

19 files changed

+120
-101
lines changed

19 files changed

+120
-101
lines changed

.github/workflows/main.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848

4949
steps:
5050
- name: checkout
51-
uses: actions/checkout@v2
51+
uses: actions/checkout@v3
5252

5353
- name: validate gradle wrapper
5454
uses: gradle/wrapper-validation-action@v1
@@ -61,10 +61,11 @@ jobs:
6161
npm test
6262
6363
- name: Java 15
64-
uses: actions/setup-java@v1
64+
uses: actions/setup-java@v3
6565
with:
66+
distribution: 'zulu'
6667
java-version: 15
67-
- uses: actions/cache@v2
68+
- uses: actions/cache@v3
6869
id: avd-cache
6970
with:
7071
path: |

.github/workflows/manually.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939

4040
steps:
4141
- name: checkout
42-
uses: actions/checkout@v2
42+
uses: actions/checkout@v3
4343

4444
- name: validate gradle wrapper
4545
uses: gradle/wrapper-validation-action@v1
@@ -52,10 +52,11 @@ jobs:
5252
npm test
5353
5454
- name: Java 15
55-
uses: actions/setup-java@v1
55+
uses: actions/setup-java@v3
5656
with:
57+
distribution: 'zulu'
5758
java-version: 15
58-
- uses: actions/cache@v2
59+
- uses: actions/cache@v3
5960
with:
6061
path: |
6162
~/.gradle/caches

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,13 @@ typings/
9191

9292
# DynamoDB Local files
9393
.dynamodb/
94+
95+
# Mac
96+
.DS_Store
97+
98+
# Vscode
99+
.vscode
100+
101+
# IntelliJ IDEA
102+
.idea
103+
*.iml

CHANGELOG.md

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

3+
## v2.24.0
4+
5+
* Add option to specify `heap-size` for the AVD. - [#245](https://github.com/ReactiveCircus/android-emulator-runner/pull/245) @timusus.
6+
37
## v2.23.0
48

59
* Update build tools to `32.0.0`. - [#212](https://github.com/ReactiveCircus/android-emulator-runner/pull/212)

README.md

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ It is recommended to run this action on a **macOS** VM, e.g. `macos-latest`, `ma
2626

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

29-
```
29+
```yml
3030
jobs:
3131
test:
3232
runs-on: macos-latest
3333
steps:
3434
- name: checkout
35-
uses: actions/checkout@v2
35+
uses: actions/checkout@v3
3636

3737
- name: run tests
3838
uses: reactivecircus/android-emulator-runner@v2
@@ -43,7 +43,7 @@ jobs:
4343
4444
We can also leverage GitHub Actions's build matrix to test across multiple configurations:
4545
46-
```
46+
```yml
4747
jobs:
4848
test:
4949
runs-on: macos-latest
@@ -53,7 +53,7 @@ jobs:
5353
target: [default, google_apis]
5454
steps:
5555
- name: checkout
56-
uses: actions/checkout@v2
56+
uses: actions/checkout@v3
5757

5858
- name: run tests
5959
uses: reactivecircus/android-emulator-runner@v2
@@ -67,13 +67,13 @@ jobs:
6767
6868
If you need specific versions of **NDK** and **CMake** installed:
6969
70-
```
70+
```yml
7171
jobs:
7272
test:
7373
runs-on: macos-latest
7474
steps:
7575
- name: checkout
76-
uses: actions/checkout@v2
76+
uses: actions/checkout@v3
7777

7878
- name: run tests
7979
uses: reactivecircus/android-emulator-runner@v2
@@ -86,11 +86,12 @@ jobs:
8686
8787
We can significantly reduce emulator startup time by setting up AVD snapshot caching:
8888
89-
1. add an `actions/cache@v2` step for caching the `avd`
90-
2. add a `reactivecircus/android-emulator-runner@v2` step to generate a clean snapshot - specify `emulator-options` without `no-snapshot`
91-
3. add another `reactivecircus/android-emulator-runner@v2` step to run your tests using existing AVD / snapshot - specify `emulator-options` with `no-snapshot-save`
89+
1. add a `gradle/gradle-build-action@v2` step for caching Gradle, more details see [#229](https://github.com/ReactiveCircus/android-emulator-runner/issues/229)
90+
2. add an `actions/cache@v3` step for caching the `avd`
91+
3. add a `reactivecircus/android-emulator-runner@v2` step to generate a clean snapshot - specify `emulator-options` without `no-snapshot`
92+
4. add another `reactivecircus/android-emulator-runner@v2` step to run your tests using existing AVD / snapshot - specify `emulator-options` with `no-snapshot-save`
9293

93-
```
94+
```yml
9495
jobs:
9596
test:
9697
runs-on: macos-latest
@@ -99,18 +100,13 @@ jobs:
99100
api-level: [21, 23, 29]
100101
steps:
101102
- name: checkout
102-
uses: actions/checkout@v2
103+
uses: actions/checkout@v3
103104
104105
- name: Gradle cache
105-
uses: actions/cache@v2
106-
with:
107-
path: |
108-
~/.gradle/caches
109-
~/.gradle/wrapper
110-
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}-${{ hashFiles('**/buildSrc/**/*.kt') }}
111-
106+
uses: gradle/gradle-build-action@v2
107+
112108
- name: AVD cache
113-
uses: actions/cache@v2
109+
uses: actions/cache@v3
114110
id: avd-cache
115111
with:
116112
path: |
@@ -148,6 +144,7 @@ jobs:
148144
| `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 device`. |
149145
| `cores` | Optional | 2 | Number of cores to use for the emulator (`hw.cpu.ncore` in config.ini). |
150146
| `ram-size` | Optional | N/A | Size of RAM to use for this AVD, in KB or MB, denoted with K or M. - e.g. `2048M` |
147+
| `heap-size` | Optional | N/A | Heap size to use for this AVD, in KB or MB, denoted with K or M. - e.g. `512M` |
151148
| `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`. |
152149
| `disk-size` | Optional | N/A | Disk size to use for this AVD. Either in bytes or KB, MB or GB, when denoted with K, M or G. - e.g. `2048M` |
153150
| `avd-name` | Optional | `test` | Custom AVD name used for creating the Android Virtual Device. |

action.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ inputs:
2121
default: 2
2222
ram-size:
2323
description: 'size of RAM to use for this AVD, in KB or MB, denoted with K or M. - e.g. `2048M`'
24+
heap-size:
25+
description: 'size of heap to use for this AVD in MB. - e.g. `512M`'
2426
sdcard-path-or-size:
2527
description: '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`'
2628
disk-size:

lib/emulator-manager.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const EMULATOR_BOOT_TIMEOUT_SECONDS = 600;
3535
/**
3636
* Creates and launches a new AVD instance with the specified configurations.
3737
*/
38-
function launchEmulator(apiLevel, target, arch, profile, cores, ramSize, sdcardPathOrSize, diskSize, avdName, forceAvdCreation, emulatorOptions, disableAnimations, disableSpellChecker, disableLinuxHardwareAcceleration, enableHardwareKeyboard) {
38+
function launchEmulator(apiLevel, target, arch, profile, cores, ramSize, heapSize, sdcardPathOrSize, diskSize, avdName, forceAvdCreation, emulatorOptions, disableAnimations, disableSpellChecker, disableLinuxHardwareAcceleration, enableHardwareKeyboard) {
3939
return __awaiter(this, void 0, void 0, function* () {
4040
try {
4141
console.log(`::group::Launch Emulator`);
@@ -53,6 +53,9 @@ function launchEmulator(apiLevel, target, arch, profile, cores, ramSize, sdcardP
5353
if (ramSize) {
5454
yield exec.exec(`sh -c \\"printf 'hw.ramSize=${ramSize}\n' >> ${process.env.ANDROID_AVD_HOME}/"${avdName}".avd"/config.ini`);
5555
}
56+
if (heapSize) {
57+
yield exec.exec(`sh -c \\"printf 'hw.heapSize=${heapSize}\n' >> ${process.env.ANDROID_AVD_HOME}/"${avdName}".avd"/config.ini`);
58+
}
5659
if (enableHardwareKeyboard) {
5760
yield exec.exec(`sh -c \\"printf 'hw.keyboard=yes\n' >> ${process.env.ANDROID_AVD_HOME}/"${avdName}".avd"/config.ini`);
5861
}

lib/main.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ function run() {
7171
// RAM to use for AVD
7272
const ramSize = core.getInput('ram-size');
7373
console.log(`RAM size: ${ramSize}`);
74+
// Heap size to use for AVD
75+
const heapSize = core.getInput('heap-size');
76+
console.log(`Heap size: ${heapSize}`);
7477
// SD card path or size used for creating the AVD
7578
const sdcardPathOrSize = core.getInput('sdcard-path-or-size');
7679
console.log(`SD card path or size: ${sdcardPathOrSize}`);
@@ -149,7 +152,7 @@ function run() {
149152
// install SDK
150153
yield sdk_installer_1.installAndroidSdk(apiLevel, target, arch, channelId, emulatorBuild, ndkVersion, cmakeVersion);
151154
// launch an emulator
152-
yield emulator_manager_1.launchEmulator(apiLevel, target, arch, profile, cores, ramSize, sdcardPathOrSize, diskSize, avdName, forceAvdCreation, emulatorOptions, disableAnimations, disableSpellchecker, disableLinuxHardwareAcceleration, enableHardwareKeyboard);
155+
yield emulator_manager_1.launchEmulator(apiLevel, target, arch, profile, cores, ramSize, heapSize, sdcardPathOrSize, diskSize, avdName, forceAvdCreation, emulatorOptions, disableAnimations, disableSpellchecker, disableLinuxHardwareAcceleration, enableHardwareKeyboard);
153156
// execute the custom script
154157
try {
155158
// move to custom working directory if set

node_modules/.package-lock.json

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

node_modules/minimist/index.js

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

0 commit comments

Comments
 (0)