Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sycn with upstream 50986b1464923454c95e261820bc626f38490ec0 #6

Closed
wants to merge 50 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
f079aca
Release v2.
ychescale9 Dec 7, 2019
da41ec9
Merge branch 'master' into release/v2
ychescale9 Dec 13, 2019
3f52989
Merge branch 'master' into release/v2
ychescale9 Dec 14, 2019
d27f7ec
Merge branch 'master' into release/v2
ychescale9 Jan 19, 2020
5dd12aa
Merge branch 'master' into release/v2
ychescale9 Jan 31, 2020
bdf1f83
Merge branch 'master' into release/v2
ychescale9 Feb 4, 2020
2754675
Merge branch 'master' into release/v2
ychescale9 Feb 15, 2020
6bb3965
Merge branch 'master' into release/v2
ychescale9 Mar 5, 2020
769ff28
Merge branch 'master' into release/v2
ychescale9 Mar 28, 2020
0159db6
Merge branch 'master' into release/v2
ychescale9 Mar 31, 2020
a3b0e6d
Update node_modules.
ychescale9 Mar 31, 2020
e4eb880
Merge branch 'master' into release/v2
ychescale9 Apr 2, 2020
2f678a7
Merge branch 'master' into release/v2
ychescale9 Apr 11, 2020
4f4106d
Merge branch 'master' into release/v2
ychescale9 May 1, 2020
e93c997
Merge branch 'master' into release/v2
ychescale9 May 29, 2020
b62c970
Merge branch 'master' into release/v2
ychescale9 Jun 12, 2020
4a8a9af
Merge branch 'main' into release/v2
ychescale9 Jun 20, 2020
c56210b
Merge branch 'main' into release/v2
ychescale9 Oct 8, 2020
07b0366
Merge branch 'main' into release/v2
ychescale9 Oct 16, 2020
e08f702
Merge branch 'main' into release/v2
ychescale9 Nov 14, 2020
02cf805
Merge branch 'main' into release/v2
ychescale9 Dec 27, 2020
70e3f6e
Merge branch 'main' into release/v2
ychescale9 Dec 28, 2020
94bd1ed
Merge branch 'main' into release/v2
ychescale9 Jan 5, 2021
08b092e
Merge branch 'main' into release/v2
ychescale9 Jan 13, 2021
d279995
Merge branch 'main' into release/v2
ychescale9 Mar 4, 2021
599839e
Merge branch 'main' into release/v2
ychescale9 May 7, 2021
226f262
Merge branch 'main' into release/v2
ychescale9 May 28, 2021
97449e9
Merge branch 'main' into release/v2
ychescale9 Jun 20, 2021
6e775ef
Merge branch 'main' into release/v2
ychescale9 Jun 25, 2021
ac874f3
Merge branch 'main' into release/v2
ychescale9 Jun 26, 2021
5de26e4
Merge branch 'main' into release/v2
ychescale9 Jul 20, 2021
f71c6d1
Merge branch 'main' into release/v2
ychescale9 Aug 28, 2021
2b2ebf2
Merge branch 'main' into release/v2
ychescale9 Oct 23, 2021
48744f2
Merge branch 'main' into release/v2
ychescale9 Dec 24, 2021
76c2bf6
Merge branch 'main' into release/v2
ychescale9 Feb 17, 2022
e790971
Merge branch 'main' into release/v2
ychescale9 Apr 30, 2022
b390b0e
Merge branch 'main' into release/v2
ychescale9 Jul 12, 2022
d7b53dd
Merge branch 'main' into release/v2
ychescale9 Sep 20, 2022
50986b1
Merge branch 'main' into release/v2
ychescale9 Oct 28, 2022
8e947e5
Support non-integer API level (#317)
yujincheng08 Feb 9, 2023
bdaf049
Add renovate.json (#320)
renovate[bot] Feb 18, 2023
bad4154
Update dependency androidx.appcompat:appcompat to v1.6.1 (#322)
renovate[bot] Feb 18, 2023
743ec40
Add emulator-boot-timeout parameter (#326)
koplyarov Mar 9, 2023
8c71f5e
SDK command-line tools 9.0. (#331)
ychescale9 Mar 18, 2023
a2c97ef
Update `test-fixture` dependencies and workflows (#332)
ychescale9 Mar 18, 2023
acd15a6
Cleanup action description.
ychescale9 Mar 18, 2023
b35b1c6
Prepare for release 2.28.0.
ychescale9 Mar 18, 2023
94069fb
Merge commit '8e947e5bd64d5db2f60a528889abc0b6907fbdfd' of github.com…
RodrigoCMoraes Apr 18, 2024
1bf1bf0
Merge commit 'b35b1c6e6921ebfd3f980c2236ac298f019df53a' of github.com…
RodrigoCMoraes Apr 18, 2024
bd21ca0
Merge commit '50986b1464923454c95e261820bc626f38490ec0' of github.com…
RodrigoCMoraes Apr 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ jobs:
npm run lint
npm test
- name: Java 15
uses: actions/setup-java@v3
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 15
java-version: 19

- uses: actions/cache@v3
id: avd-cache
with:
Expand Down
13 changes: 5 additions & 8 deletions .github/workflows/manually.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,14 @@ jobs:
npm run lint
npm test
- name: Java 15
uses: actions/setup-java@v3
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 15
- uses: actions/cache@v3
java-version: 19

- uses: gradle/gradle-build-action@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
gradle-home-cache-cleanup: true

- name: run action
uses: ./
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
__tests__/runner/*

# comment out in distribution branches
node_modules/
# node_modules/

# Rest pulled from https://github.com/github/gitignore/blob/master/Node.gitignore
# Logs
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Change Log

## v2.28.0

* Add `emulator-boot-timeout` to support configuring maximum time waiting for emulator boot. - [#326](https://github.com/ReactiveCircus/android-emulator-runner/pull/326)
* Support non-integer `api-level`. - [#317](https://github.com/ReactiveCircus/android-emulator-runner/pull/317)
* Replace deprecated `ANDROID_SDK_ROOT` with `ANDROID_HOME`. - [304](https://github.com/ReactiveCircus/android-emulator-runner/pull/304)
* Update SDK command-line tools to `9.0`. - [#331](https://github.com/ReactiveCircus/android-emulator-runner/pull/331)
* Update SDK build tools to `33.0.2`. - [#331](https://github.com/ReactiveCircus/android-emulator-runner/pull/331)

## v2.27.0

* Added `pre-emulator-launch-script` to support running script after creating the AVD and before launching the emulator. - [#247](https://github.com/ReactiveCircus/android-emulator-runner/pull/247) @nilsreichardt.
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ jobs:
| `disk-size` | Optional | N/A | Disk size, or partition size to use for this AVD. Either in bytes or KB, MB or GB, when denoted with K, M or G. - e.g. `2048M` |
| `avd-name` | Optional | `test` | Custom AVD name used for creating the Android Virtual Device. |
| `force-avd-creation` | Optional | `true` | Whether to force create the AVD by overwriting an existing AVD with the same name as `avd-name` - `true` or `false`. |
| `emulator-boot-timeout` | Optional | `600` | Emulator boot timeout in seconds. If it takes longer to boot, the action would fail - e.g. `300` for 5 minutes. |
| `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`. |
| `disable-spellchecker` | Optional | `false` | Whether to disable spellchecker - `true` or `false`. |
Expand Down
8 changes: 8 additions & 0 deletions __tests__/input-validator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ describe('api-level validator tests', () => {
validator.checkApiLevel('29');
};
expect(func2).not.toThrow();
const func3 = () => {
validator.checkApiLevel('UpsideDownCake-ext5');
};
expect(func3).not.toThrow();
const func4 = () => {
validator.checkApiLevel('TiramisuPrivacySandbox');
};
expect(func4).not.toThrow();
});
});

Expand Down
2 changes: 2 additions & 0 deletions action-types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ inputs:
type: string
force-avd-creation:
type: boolean
emulator-boot-timeout:
type: integer
emulator-options:
type: string
disable-animations:
Expand Down
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ inputs:
force-avd-creation:
description: 'whether to force create the AVD by overwriting an existing AVD with the same name as `avd-name` - `true` or `false`'
default: 'true'
emulator-boot-timeout:
description: 'Emulator boot timeout in seconds. If it takes longer to boot, the action would fail - e.g. `300` for 5 minutes'
default: '600'
emulator-options:
description: 'command-line options used when launching the emulator - e.g. `-no-window -no-snapshot -camera-back emulated`'
default: '-no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim'
Expand Down
9 changes: 4 additions & 5 deletions lib/emulator-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
exports.killEmulator = exports.launchEmulator = void 0;
const exec = __importStar(require("@actions/exec"));
const fs = __importStar(require("fs"));
const EMULATOR_BOOT_TIMEOUT_SECONDS = 600;
/**
* Creates and launches a new AVD instance with the specified configurations.
*/
function launchEmulator(apiLevel, target, arch, profile, cores, ramSize, heapSize, sdcardPathOrSize, diskSize, avdName, forceAvdCreation, emulatorOptions, disableAnimations, disableSpellChecker, disableLinuxHardwareAcceleration, enableHardwareKeyboard) {
function launchEmulator(apiLevel, target, arch, profile, cores, ramSize, heapSize, sdcardPathOrSize, diskSize, avdName, forceAvdCreation, emulatorBootTimeout, emulatorOptions, disableAnimations, disableSpellChecker, disableLinuxHardwareAcceleration, enableHardwareKeyboard) {
return __awaiter(this, void 0, void 0, function* () {
try {
console.log(`::group::Launch Emulator`);
Expand Down Expand Up @@ -84,7 +83,7 @@ function launchEmulator(apiLevel, target, arch, profile, cores, ramSize, heapSiz
},
});
// wait for emulator to complete booting
yield waitForDevice();
yield waitForDevice(emulatorBootTimeout);
yield exec.exec(`adb shell input keyevent 82`);
if (disableAnimations) {
console.log('Disabling animations.');
Expand Down Expand Up @@ -126,12 +125,12 @@ exports.killEmulator = killEmulator;
/**
* Wait for emulator to boot.
*/
function waitForDevice() {
function waitForDevice(emulatorBootTimeout) {
return __awaiter(this, void 0, void 0, function* () {
let booted = false;
let attempts = 0;
const retryInterval = 2; // retry every 2 seconds
const maxAttempts = EMULATOR_BOOT_TIMEOUT_SECONDS / 2;
const maxAttempts = emulatorBootTimeout / 2;
while (!booted) {
try {
let result = '';
Expand Down
2 changes: 2 additions & 0 deletions lib/input-validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ exports.VALID_TARGETS = ['default', 'google_apis', 'aosp_atd', 'google_atd', 'go
exports.VALID_ARCHS = ['x86', 'x86_64', 'arm64-v8a'];
exports.VALID_CHANNELS = ['stable', 'beta', 'dev', 'canary'];
function checkApiLevel(apiLevel) {
if (apiLevel.startsWith('UpsideDownCake') || apiLevel === 'TiramisuPrivacySandbox')
return;
if (isNaN(Number(apiLevel)) || !Number.isInteger(Number(apiLevel))) {
throw new Error(`Unexpected API level: '${apiLevel}'.`);
}
Expand Down
10 changes: 6 additions & 4 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,8 @@ function run() {
}
}
// API level of the platform and system image
const apiLevelInput = core.getInput('api-level', { required: true });
(0, input_validator_1.checkApiLevel)(apiLevelInput);
const apiLevel = Number(apiLevelInput);
const apiLevel = core.getInput('api-level', { required: true });
(0, input_validator_1.checkApiLevel)(apiLevel);
console.log(`API level: ${apiLevel}`);
// target of the system image
const targetInput = core.getInput('target');
Expand Down Expand Up @@ -100,6 +99,9 @@ function run() {
(0, input_validator_1.checkForceAvdCreation)(forceAvdCreationInput);
const forceAvdCreation = forceAvdCreationInput === 'true';
console.log(`force avd creation: ${forceAvdCreation}`);
// Emulator boot timeout seconds
const emulatorBootTimeout = parseInt(core.getInput('emulator-boot-timeout'), 10);
console.log(`Emulator boot timeout: ${emulatorBootTimeout}`);
// emulator options
const emulatorOptions = core.getInput('emulator-options').trim();
console.log(`emulator options: ${emulatorOptions}`);
Expand Down Expand Up @@ -191,7 +193,7 @@ function run() {
console.log(`::endgroup::`);
}
// launch an emulator
yield (0, emulator_manager_1.launchEmulator)(apiLevel, target, arch, profile, cores, ramSize, heapSize, sdcardPathOrSize, diskSize, avdName, forceAvdCreation, emulatorOptions, disableAnimations, disableSpellchecker, disableLinuxHardwareAcceleration, enableHardwareKeyboard);
yield (0, emulator_manager_1.launchEmulator)(apiLevel, target, arch, profile, cores, ramSize, heapSize, sdcardPathOrSize, diskSize, avdName, forceAvdCreation, emulatorBootTimeout, emulatorOptions, disableAnimations, disableSpellchecker, disableLinuxHardwareAcceleration, enableHardwareKeyboard);
// execute the custom script
try {
// move to custom working directory if set
Expand Down
9 changes: 5 additions & 4 deletions lib/sdk-installer.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@ const exec = __importStar(require("@actions/exec"));
const io = __importStar(require("@actions/io"));
const tc = __importStar(require("@actions/tool-cache"));
const fs = __importStar(require("fs"));
const BUILD_TOOLS_VERSION = '33.0.0';
const CMDLINE_TOOLS_URL_MAC = 'https://dl.google.com/android/repository/commandlinetools-mac-9123335_latest.zip';
const CMDLINE_TOOLS_URL_LINUX = 'https://dl.google.com/android/repository/commandlinetools-linux-9123335_latest.zip';
const BUILD_TOOLS_VERSION = '33.0.2';
// SDK command-line tools 9.0
const CMDLINE_TOOLS_URL_MAC = 'https://dl.google.com/android/repository/commandlinetools-mac-9477386_latest.zip';
const CMDLINE_TOOLS_URL_LINUX = 'https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip';
/**
* Installs & updates the Android SDK for the macOS platform, including SDK platform for the chosen API level, latest build tools, platform tools, Android Emulator,
* and the system image for the chosen API level, CPU arch, and target.
Expand Down Expand Up @@ -68,7 +69,7 @@ function installAndroidSdk(apiLevel, target, arch, channelId, emulatorBuild, ndk
// accept all Android SDK licenses
yield exec.exec(`sh -c \\"yes | sdkmanager --licenses > /dev/null"`);
console.log('Installing latest build tools, platform tools, and platform.');
yield exec.exec(`sh -c \\"sdkmanager --install 'build-tools;${BUILD_TOOLS_VERSION}' platform-tools 'platforms;android-${apiLevel}' > /dev/null"`);
yield exec.exec(`sh -c \\"sdkmanager --install 'build-tools;${BUILD_TOOLS_VERSION}' platform-tools > /dev/null"`);
console.log('Installing latest emulator.');
yield exec.exec(`sh -c \\"sdkmanager --install emulator --channel=${channelId} > /dev/null"`);
if (emulatorBuild) {
Expand Down
1 change: 1 addition & 0 deletions node_modules/.bin/semver

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/uuid

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

136 changes: 136 additions & 0 deletions node_modules/.package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions node_modules/@actions/core/LICENSE.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading