Support running on linux without hardware accleration.

This commit is contained in:
Yang Chen
2020-03-27 00:19:17 +11:00
committed by Yang
parent 490f28e17c
commit 345ace6178
8 changed files with 68 additions and 41 deletions
+9 -9
View File
@@ -24,9 +24,14 @@ const script_parser_1 = require("./script-parser");
function run() {
return __awaiter(this, void 0, void 0, function* () {
try {
// only support running on macOS
// only support running on macOS or Linux
if (process.platform !== 'darwin') {
throw new Error('This action is expected to be run within a macOS virtual machine to enable hardware acceleration.');
if (process.platform === 'linux') {
console.warn(`You're running a Linux VM where hardware acceleration is not available. Please consider using a macOS VM instead to take advantage of native hardware acceleration support provided by HAXM.`);
}
else {
throw new Error('Unsupported virtual machine: please use either macos or ubuntu VM.');
}
}
// API level of the platform and system image
const apiLevelInput = core.getInput('api-level', { required: true });
@@ -74,13 +79,8 @@ function run() {
}));
// install SDK
yield sdk_installer_1.installAndroidSdk(apiLevel, target, arch, emulatorBuild);
try {
// launch an emulator
yield emulator_manager_1.launchEmulator(apiLevel, target, arch, profile, emulatorOptions, disableAnimations);
}
catch (error) {
core.setFailed(error.message);
}
// launch an emulator
yield emulator_manager_1.launchEmulator(apiLevel, target, arch, profile, emulatorOptions, disableAnimations);
// execute the custom script
try {
// move to custom working directory if set