Add support for providing any emulator launch options as action input. Remove headless input which might overlap with emulator-options.

This commit is contained in:
Yang Chen
2019-12-07 17:48:02 +11:00
committed by ychescale9
parent 0d46bc07bd
commit 0d276b963a
10 changed files with 50 additions and 69 deletions
+8 -10
View File
@@ -43,11 +43,9 @@ function run() {
// Hardware profile used for creating the AVD
const profile = core.getInput('profile');
console.log(`Hardware profile: ${profile}`);
// headless mode
const headlessInput = core.getInput('headless');
input_validator_1.checkHeadless(headlessInput);
const headless = headlessInput === 'true';
console.log(`headless mode: ${headless}`);
// emulator options
const emulatorOptions = core.getInput('emulator-options').trim();
console.log(`emulator options: ${emulatorOptions}`);
// disable animations
const disableAnimationsInput = core.getInput('disable-animations');
input_validator_1.checkDisableAnimations(disableAnimationsInput);
@@ -55,12 +53,12 @@ function run() {
console.log(`disable animations: ${disableAnimations}`);
// custom scrpt to run
const script = core.getInput('script', { required: true });
// install SDK
yield sdk_installer_1.installAndroidSdk(apiLevel, target, arch);
// launch an emulator
yield emulator_manager_1.launchEmulator(apiLevel, target, arch, profile, headless, disableAnimations);
// execute the custom script
try {
// install SDK
yield sdk_installer_1.installAndroidSdk(apiLevel, target, arch);
// launch an emulator
yield emulator_manager_1.launchEmulator(apiLevel, target, arch, profile, emulatorOptions, disableAnimations);
// execute the custom script
yield exec.exec(`${script}`);
}
catch (error) {