Compare commits

..

5 Commits

Author SHA1 Message Date
Yang f3572f51f0 WIP fix platform check. 2020-09-03 01:13:19 +10:00
Yang 7f954888fa WIP run with sdkmanager.bat for windows. 2020-09-03 01:07:14 +10:00
Yang f9ac2a7b31 Download cmdline-tools with actions/tool-cache. 2020-09-03 00:51:14 +10:00
Yang 098ef337be WIP - download correct SDK for each platform. 2020-09-03 00:34:04 +10:00
Yang b7eed610b6 WIP - windows support 2020-09-03 00:03:34 +10:00
15 changed files with 134 additions and 333 deletions
+15 -53
View File
@@ -3,43 +3,21 @@ on:
pull_request: pull_request:
push: push:
branches: branches:
# - main - main
- 'yc/*' - 'yc/windows-support'
paths-ignore: paths-ignore:
- '**.md' - '**.md'
jobs: jobs:
test: test:
# runs-on: ${{ matrix.os }} runs-on: windows-latest
runs-on: macos-latest
env: env:
JAVA_TOOL_OPTIONS: -Xmx4g JAVA_TOOL_OPTIONS: -Xmx4g
timeout-minutes: 15 timeout-minutes: 15
strategy: strategy:
fail-fast: false
matrix: matrix:
# os: [macos-latest, ubuntu-latest] api-level: [16, 23, 29]
api-level: [23, 24, 25, 26, 27, 28, 29, 30] target: [default, google_apis]
# target: [default, google_apis]
# exclude:
# - os: ubuntu-latest
# api-level: 23
# - os: ubuntu-latest
# api-level: 29
# - target: google_apis
# api-level: 16
# - target: google_apis
# api-level: 23
# - target: google_apis
# api-level: 29
# include:
# - os: macos-latest
# api-level: 30
# target: google_apis
# - os: macos-latest
# api-level: 24
# target: playstore
steps: steps:
- name: checkout - name: checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
@@ -49,48 +27,32 @@ jobs:
- name: build, test and lint - name: build, test and lint
run: | run: |
npm ci npm install
npm run build npm run build
npm run lint npm run lint
npm test npm test
- name: Java 15 - name: Java 14
uses: actions/setup-java@v1 uses: actions/setup-java@v1
with: with:
java-version: 15 java-version: 14
- uses: actions/cache@v2 - uses: actions/cache@v1
with: with:
path: | path: ~/.gradle/caches
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
- name: run action - name: run action
uses: ./ uses: ./
with: with:
api-level: ${{ matrix.api-level }} api-level: ${{ matrix.api-level }}
target: default target: ${{ matrix.target }}
arch: x86 arch: x86
# profile: Nexus 6 profile: Nexus 6
profile: pixel_3a avd-name: test
# avd-name: test
emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -camera-back none emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -camera-back none
disable-animations: true disable-animations: true
working-directory: ./test-fixture/ working-directory: ./test-fixture/
script: | script: |
echo $GITHUB_REPOSITORY echo $GITHUB_REPOSITORY
adb devices adb devices
adb shell ls -la /sdcard ./gradlew help
adb shell ls -la /storage ./gradlew connectedDebugAndroidTest
adb emu geo fix 0 51
adb shell screenrecord --verbose /sdcard/capture.mpg &
adb shell pkill -INT screenrecord
mkdir -p app/build/report
cd app/build/report && adb pull /sdcard/capture.mpg
# ./gradlew help
# ./gradlew connectedDebugAndroidTest
- name: Upload build artifacts
uses: actions/upload-artifact@v1
with:
name: build-outputs
path: ./test-fixture/app/build/report
-19
View File
@@ -1,24 +1,5 @@
# Change Log # Change Log
## v2.12.0
Added support for using the `playstore` system images:
```
- name: run tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 30
target: playstore
arch: x86
script: ./gradlew connectedCheck
```
## v2.11.1
* Update SDK command-line tools to `2.1`.
* Update @actions/core to `1.2.6`.
## v2.11.0 ## v2.11.0
* Support running multiple instances of the action sequentially in a single job - [#73](https://github.com/ReactiveCircus/android-emulator-runner/issues/73). * Support running multiple instances of the action sequentially in a single job - [#73](https://github.com/ReactiveCircus/android-emulator-runner/issues/73).
+4 -5
View File
@@ -8,7 +8,7 @@ A GitHub Action for installing, configuring and running hardware-accelerated And
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). 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).
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 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
tests directly on the VM. tests directly on the VM.
This action automates the process by doing the following: This action automates the process by doing the following:
@@ -86,10 +86,10 @@ jobs:
## Configurations ## Configurations
| **Input** | **Required** | **Default** | **Description** | | | **Required** | **Default** | **Description** |
|-|-|-|-| |----------------------|--------------|-------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `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**. | | `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**. |
| `target` | Optional | `default` | Target of the system image - `default`, `google_apis` or `playstore`. | | `target` | Optional | `default` | Target of the system image - `default` or `google_apis`. |
| `arch` | Optional | `x86` | CPU architecture of the system image - `x86` or `x86_64`. Note that `x86_64` image is only available for API 21+. | | `arch` | Optional | `x86` | CPU architecture of the system image - `x86` or `x86_64`. Note that `x86_64` image is only available for API 21+. |
| `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". | | `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". |
| `avd-name` | Optional | `test` | Custom AVD name used for creating the Android Virtual Device. | | `avd-name` | Optional | `test` | Custom AVD name used for creating the Android Virtual Device. |
@@ -132,6 +132,5 @@ These are some of the open-source projects using (or used) **Android Emulator Ru
- [simpledotorg/simple-android](https://github.com/simpledotorg/simple-android) - [simpledotorg/simple-android](https://github.com/simpledotorg/simple-android)
- [cashapp/copper](https://github.com/cashapp/copper/blob/trunk/.github/workflows/build.yaml) - [cashapp/copper](https://github.com/cashapp/copper/blob/trunk/.github/workflows/build.yaml)
- [square/radiography](https://github.com/square/radiography/blob/main/.github/workflows/android.yml) - [square/radiography](https://github.com/square/radiography/blob/main/.github/workflows/android.yml)
- [Shopify/android-testify](https://github.com/Shopify/android-testify/blob/master/.github/workflows/sample_build.yml)
If you are using **Android Emulator Runner** and want your project included in the list, please feel free to create an issue or open a pull request. If you are using **Android Emulator Runner** and want your project included in the list, please feel free to create an issue or open a pull request.
-5
View File
@@ -53,11 +53,6 @@ describe('target validator tests', () => {
validator.checkTarget('google_apis'); validator.checkTarget('google_apis');
}; };
expect(func2).not.toThrow(); expect(func2).not.toThrow();
const func3 = () => {
validator.checkTarget('google_apis');
};
expect(func3).not.toThrow();
}); });
}); });
+1 -1
View File
@@ -9,7 +9,7 @@ inputs:
description: 'API level of the platform and system image - e.g. 23 for Android Marshmallow, 29 for Android 10' description: 'API level of the platform and system image - e.g. 23 for Android Marshmallow, 29 for Android 10'
required: true required: true
target: target:
description: 'target of the system image - default, google_apis or playstore' description: 'target of the system image - default or google_apis'
default: 'default' default: 'default'
arch: arch:
description: 'CPU architecture of the system image - x86 or x86_64' description: 'CPU architecture of the system image - x86 or x86_64'
+1 -1
View File
@@ -2,7 +2,7 @@
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.checkEmulatorBuild = exports.checkDisableAnimations = exports.checkArch = exports.checkTarget = exports.checkApiLevel = exports.VALID_ARCHS = exports.VALID_TARGETS = exports.MIN_API_LEVEL = void 0; exports.checkEmulatorBuild = exports.checkDisableAnimations = exports.checkArch = exports.checkTarget = exports.checkApiLevel = exports.VALID_ARCHS = exports.VALID_TARGETS = exports.MIN_API_LEVEL = void 0;
exports.MIN_API_LEVEL = 15; exports.MIN_API_LEVEL = 15;
exports.VALID_TARGETS = ['default', 'google_apis', 'google_apis_playstore']; exports.VALID_TARGETS = ['default', 'google_apis'];
exports.VALID_ARCHS = ['x86', 'x86_64']; exports.VALID_ARCHS = ['x86', 'x86_64'];
function checkApiLevel(apiLevel) { function checkApiLevel(apiLevel) {
if (isNaN(Number(apiLevel)) || !Number.isInteger(Number(apiLevel))) { if (isNaN(Number(apiLevel)) || !Number.isInteger(Number(apiLevel))) {
+3 -10
View File
@@ -37,14 +37,8 @@ const script_parser_1 = require("./script-parser");
function run() { function run() {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
try { try {
// only support running on macOS or Linux if (process.platform === 'linux') {
if (process.platform !== 'darwin') { 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.`);
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 // API level of the platform and system image
const apiLevelInput = core.getInput('api-level', { required: true }); const apiLevelInput = core.getInput('api-level', { required: true });
@@ -52,8 +46,7 @@ function run() {
const apiLevel = Number(apiLevelInput); const apiLevel = Number(apiLevelInput);
console.log(`API level: ${apiLevel}`); console.log(`API level: ${apiLevel}`);
// target of the system image // target of the system image
const targetInput = core.getInput('target'); const target = core.getInput('target');
const target = targetInput == 'playstore' ? 'google_apis_playstore' : targetInput;
input_validator_1.checkTarget(target); input_validator_1.checkTarget(target);
console.log(`target: ${target}`); console.log(`target: ${target}`);
// CPU architecture of the system image // CPU architecture of the system image
+19 -19
View File
@@ -35,34 +35,34 @@ const io = __importStar(require("@actions/io"));
const tc = __importStar(require("@actions/tool-cache")); const tc = __importStar(require("@actions/tool-cache"));
const fs = __importStar(require("fs")); const fs = __importStar(require("fs"));
const BUILD_TOOLS_VERSION = '30.0.2'; const BUILD_TOOLS_VERSION = '30.0.2';
const CMDLINE_TOOLS_URL_MAC = 'https://dl.google.com/android/repository/commandlinetools-mac-6858069_latest.zip'; const CMDLINE_TOOLS_URL_MAC = 'https://dl.google.com/android/repository/commandlinetools-mac-6609375_latest.zip';
const CMDLINE_TOOLS_URL_LINUX = 'https://dl.google.com/android/repository/commandlinetools-linux-6858069_latest.zip'; const CMDLINE_TOOLS_URL_WIN = 'https://dl.google.com/android/repository/commandlinetools-win-6609375_latest.zip';
const CMDLINE_TOOLS_URL_LINUX = 'https://dl.google.com/android/repository/commandlinetools-linux-6609375_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, * 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. * and the system image for the chosen API level, CPU arch, and target.
*/ */
function installAndroidSdk(apiLevel, target, arch, emulatorBuild, ndkVersion, cmakeVersion) { function installAndroidSdk(apiLevel, target, arch, emulatorBuild, ndkVersion, cmakeVersion) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
const isOnMac = process.platform === 'darwin'; const IS_MAC = process.platform === 'darwin';
if (!isOnMac) { const IS_WINDOWS = process.platform === 'win32';
const IS_LINUX = process.platform === 'linux';
if (IS_LINUX) {
yield exec.exec(`sh -c \\"sudo chown $USER:$USER ${process.env.ANDROID_HOME} -R`); yield exec.exec(`sh -c \\"sudo chown $USER:$USER ${process.env.ANDROID_HOME} -R`);
} }
const cmdlineToolsPath = `${process.env.ANDROID_HOME}/cmdline-tools`; const cmdlineToolsPath = `${process.env.ANDROID_HOME}/cmdline-tools`;
if (!fs.existsSync(cmdlineToolsPath)) { if (!fs.existsSync(cmdlineToolsPath)) {
console.log('Installing new cmdline-tools.'); console.log('Installing new cmdline-tools.');
const sdkUrl = isOnMac ? CMDLINE_TOOLS_URL_MAC : CMDLINE_TOOLS_URL_LINUX; yield io.mkdirP(`${process.env.ANDROID_HOME}/cmdline-tools`);
// await io.mkdirP(cmdlineToolsPath); const sdkUrl = IS_MAC ? CMDLINE_TOOLS_URL_MAC : IS_WINDOWS ? CMDLINE_TOOLS_URL_WIN : CMDLINE_TOOLS_URL_LINUX;
const downloadPath = yield tc.downloadTool(sdkUrl); const downloadPath = yield tc.downloadTool(sdkUrl);
yield tc.extractZip(downloadPath, cmdlineToolsPath); yield tc.extractZip(downloadPath, cmdlineToolsPath);
yield io.mv(`${cmdlineToolsPath}/cmdline-tools`, `${cmdlineToolsPath}/latest`);
yield exec.exec(`ls -la ${cmdlineToolsPath}`);
// add paths for commandline-tools and platform-tools // add paths for commandline-tools and platform-tools
core.addPath(`${cmdlineToolsPath}/latest:${cmdlineToolsPath}/latest/bin:${process.env.ANDROID_HOME}/platform-tools`); core.addPath(`${cmdlineToolsPath}/tools:${cmdlineToolsPath}/tools/bin:${process.env.ANDROID_HOME}/platform-tools`);
yield exec.exec(`ls -la ${cmdlineToolsPath}/latest`);
} }
// additional permission and license requirements for Linux // additional permission and license requirements for Linux
const sdkPreviewLicensePath = `${process.env.ANDROID_HOME}/licenses/android-sdk-preview-license`; const sdkPreviewLicensePath = `${process.env.ANDROID_HOME}/licenses/android-sdk-preview-license`;
if (!isOnMac && !fs.existsSync(sdkPreviewLicensePath)) { if (IS_LINUX && !fs.existsSync(sdkPreviewLicensePath)) {
fs.writeFileSync(sdkPreviewLicensePath, '\n84831b9409646a918e30573bab4c9c91346d8abd'); fs.writeFileSync(sdkPreviewLicensePath, '\n84831b9409646a918e30573bab4c9c91346d8abd');
} }
// license required for API 30 system images // license required for API 30 system images
@@ -71,27 +71,27 @@ function installAndroidSdk(apiLevel, target, arch, emulatorBuild, ndkVersion, cm
fs.writeFileSync(sdkArmDbtLicensePath, '\n859f317696f67ef3d7f30a50a5560e7834b43903'); fs.writeFileSync(sdkArmDbtLicensePath, '\n859f317696f67ef3d7f30a50a5560e7834b43903');
} }
console.log('Installing latest build tools, platform tools, and platform.'); 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"`); const sdkmanagerExec = IS_WINDOWS ? 'sdkmanager.bat' : 'sdkmanager';
yield exec.exec(`sh -c \\"${sdkmanagerExec} --install 'build-tools;${BUILD_TOOLS_VERSION}' platform-tools 'platforms;android-${apiLevel}' > /dev/null"`);
if (emulatorBuild) { if (emulatorBuild) {
console.log(`Installing emulator build ${emulatorBuild}.`); console.log(`Installing emulator build ${emulatorBuild}.`);
yield exec.exec(`curl -fo emulator.zip https://dl.google.com/android/repository/emulator-${isOnMac ? 'darwin' : 'linux'}-${emulatorBuild}.zip`);
yield io.rmRF(`${process.env.ANDROID_HOME}/emulator`); yield io.rmRF(`${process.env.ANDROID_HOME}/emulator`);
yield exec.exec(`unzip -q emulator.zip -d ${process.env.ANDROID_HOME}`); const downloadPath = yield tc.downloadTool(`https://dl.google.com/android/repository/emulator-${IS_MAC ? 'darwin' : IS_WINDOWS ? 'windows' : 'linux'}-${emulatorBuild}.zip`);
yield io.rmRF('emulator.zip'); yield tc.extractZip(downloadPath, process.env.ANDROID_HOME);
} }
else { else {
console.log('Installing latest emulator.'); console.log('Installing latest emulator.');
yield exec.exec(`sh -c \\"sdkmanager --install emulator > /dev/null"`); yield exec.exec(`sh -c \\"${sdkmanagerExec} --install emulator > /dev/null"`);
} }
console.log('Installing system images.'); console.log('Installing system images.');
yield exec.exec(`sh -c \\"sdkmanager --install 'system-images;android-${apiLevel};${target};${arch}' > /dev/null"`); yield exec.exec(`sh -c \\"${sdkmanagerExec} --install 'system-images;android-${apiLevel};${target};${arch}' > /dev/null"`);
if (ndkVersion) { if (ndkVersion) {
console.log(`Installing NDK ${ndkVersion}.`); console.log(`Installing NDK ${ndkVersion}.`);
yield exec.exec(`sh -c \\"sdkmanager --install 'ndk;${ndkVersion}' > /dev/null"`); yield exec.exec(`sh -c \\"${sdkmanagerExec} --install 'ndk;${ndkVersion}' > /dev/null"`);
} }
if (cmakeVersion) { if (cmakeVersion) {
console.log(`Installing CMake ${cmakeVersion}.`); console.log(`Installing CMake ${cmakeVersion}.`);
yield exec.exec(`sh -c \\"sdkmanager --install 'cmake;${cmakeVersion}' > /dev/null"`); yield exec.exec(`sh -c \\"${sdkmanagerExec} --install 'cmake;${cmakeVersion}' > /dev/null"`);
} }
}); });
} }
+59 -180
View File
@@ -5,9 +5,9 @@
"requires": true, "requires": true,
"dependencies": { "dependencies": {
"@actions/core": { "@actions/core": {
"version": "1.2.6", "version": "1.2.4",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.6.tgz", "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.4.tgz",
"integrity": "sha512-ZQYitnqiyBc3D+k7LsgSBmMDVkOVidaagDG7j3fOym77jNunWRuYx7VSHa9GNfFZh+zh61xsCjRj4JxMZlDqTA==" "integrity": "sha512-YJCEq8BE3CdN8+7HPZ/4DxJjk/OkZV2FFIf+DlZTC/4iBlzYCD5yjRR6eiOS5llO11zbRltIRuKAjMKaWTE6cg=="
}, },
"@actions/exec": { "@actions/exec": {
"version": "1.0.4", "version": "1.0.4",
@@ -1403,9 +1403,9 @@
"dev": true "dev": true
}, },
"@types/node": { "@types/node": {
"version": "12.12.64", "version": "12.12.50",
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.64.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.50.tgz",
"integrity": "sha512-UV1/ZJMC+HcP902wWdpC43cAcGu0IQk/I5bXjP2aSuCjsk3cE74mDvFrLKga7oDC170ugOAYBwfT4DSQW3akDA==", "integrity": "sha512-5ImO01Fb8YsEOYpV+aeyGYztcYcjGsBvN4D7G5r1ef2cuQOpymjWNQi5V0rKHE6PC2ru3HkoUr/Br2/8GUA84w==",
"dev": true "dev": true
}, },
"@types/normalize-package-data": { "@types/normalize-package-data": {
@@ -2421,20 +2421,20 @@
} }
}, },
"es-abstract": { "es-abstract": {
"version": "1.17.7", "version": "1.17.6",
"resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.6.tgz",
"integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==", "integrity": "sha512-Fr89bON3WFyUi5EvAeI48QTWX0AyekGgLA8H+c+7fbfCkJwRWRMLd8CQedNEyJuoYYhmtEqY92pgte1FAhBlhw==",
"dev": true, "dev": true,
"requires": { "requires": {
"es-to-primitive": "^1.2.1", "es-to-primitive": "^1.2.1",
"function-bind": "^1.1.1", "function-bind": "^1.1.1",
"has": "^1.0.3", "has": "^1.0.3",
"has-symbols": "^1.0.1", "has-symbols": "^1.0.1",
"is-callable": "^1.2.2", "is-callable": "^1.2.0",
"is-regex": "^1.1.1", "is-regex": "^1.1.0",
"object-inspect": "^1.8.0", "object-inspect": "^1.7.0",
"object-keys": "^1.1.1", "object-keys": "^1.1.1",
"object.assign": "^4.1.1", "object.assign": "^4.1.0",
"string.prototype.trimend": "^1.0.1", "string.prototype.trimend": "^1.0.1",
"string.prototype.trimstart": "^1.0.1" "string.prototype.trimstart": "^1.0.1"
} }
@@ -2532,9 +2532,9 @@
} }
}, },
"eslint-config-prettier": { "eslint-config-prettier": {
"version": "6.12.0", "version": "6.11.0",
"resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-6.12.0.tgz", "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-6.11.0.tgz",
"integrity": "sha512-9jWPlFlgNwRUYVoujvWTQ1aMO8o6648r+K7qU7K5Jmkbyqav1fuEZC0COYpGBxyiAJb65Ra9hrmFx19xRGwXWw==", "integrity": "sha512-oB8cpLWSAjOVFEJhhyMZh6NOEOtBVziaqdDQ86+qhDHFbZXoRTM7pNSvFRfW/W/L/LrQ38C99J5CGuRBBzBsdA==",
"dev": true, "dev": true,
"requires": { "requires": {
"get-stdin": "^6.0.0" "get-stdin": "^6.0.0"
@@ -2595,9 +2595,9 @@
} }
}, },
"eslint-plugin-import": { "eslint-plugin-import": {
"version": "2.22.1", "version": "2.22.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.22.1.tgz", "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.22.0.tgz",
"integrity": "sha512-8K7JjINHOpH64ozkAhpT3sd+FswIZTfMZTjdx052pnWrgRCVfp8op9tbjpAk3DdUeI/Ba4C8OjdC0r90erHEOw==", "integrity": "sha512-66Fpf1Ln6aIS5Gr/55ts19eUuoDhAbZgnr6UxK5hbDx6l/QgQgx61AePq+BV4PP2uXQFClgMVzep5zZ94qqsxg==",
"dev": true, "dev": true,
"requires": { "requires": {
"array-includes": "^3.1.1", "array-includes": "^3.1.1",
@@ -2605,7 +2605,7 @@
"contains-path": "^0.1.0", "contains-path": "^0.1.0",
"debug": "^2.6.9", "debug": "^2.6.9",
"doctrine": "1.5.0", "doctrine": "1.5.0",
"eslint-import-resolver-node": "^0.3.4", "eslint-import-resolver-node": "^0.3.3",
"eslint-module-utils": "^2.6.0", "eslint-module-utils": "^2.6.0",
"has": "^1.0.3", "has": "^1.0.3",
"minimatch": "^3.0.4", "minimatch": "^3.0.4",
@@ -3617,9 +3617,9 @@
"dev": true "dev": true
}, },
"is-callable": { "is-callable": {
"version": "1.2.2", "version": "1.2.0",
"resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.2.tgz", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.0.tgz",
"integrity": "sha512-dnMqspv5nU3LoewK2N/y7KLtxtakvTuaCsU9FU50/QDmdbHNy/4/JuRtMHqRU22o3q+W89YQndQEeCVwK+3qrA==", "integrity": "sha512-pyVD9AaGLxtg6srb2Ng6ynWJqkHU9bEM087AKck0w8QwDarTfNcpIYoU8x8Hv2Icm8u6kFJM18Dag8lyqGkviw==",
"dev": true "dev": true
}, },
"is-ci": { "is-ci": {
@@ -3716,12 +3716,6 @@
"is-extglob": "^2.1.1" "is-extglob": "^2.1.1"
} }
}, },
"is-negative-zero": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.0.tgz",
"integrity": "sha1-lVOxIbD6wohp2p7UWeIMdUN4hGE=",
"dev": true
},
"is-number": { "is-number": {
"version": "7.0.0", "version": "7.0.0",
"resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
@@ -3738,9 +3732,9 @@
} }
}, },
"is-regex": { "is-regex": {
"version": "1.1.1", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.1.tgz", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.0.tgz",
"integrity": "sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg==", "integrity": "sha512-iI97M8KTWID2la5uYXlkbSDQIg4F6o1sYboZKKTDpnDQMLtUL86zxhgDet3Q2SriaYsyGqZ6Mn2SjbRKeLHdqw==",
"dev": true, "dev": true,
"requires": { "requires": {
"has-symbols": "^1.0.1" "has-symbols": "^1.0.1"
@@ -6768,37 +6762,15 @@
} }
}, },
"object.assign": { "object.assign": {
"version": "4.1.1", "version": "4.1.0",
"resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.1.tgz", "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz",
"integrity": "sha512-VT/cxmx5yaoHSOTSyrCygIDFco+RsibY2NM0a4RdEeY/4KgqezwFtK1yr3U67xYhqJSlASm2pKhLVzPj2lr4bA==", "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==",
"dev": true, "dev": true,
"requires": { "requires": {
"define-properties": "^1.1.3", "define-properties": "^1.1.2",
"es-abstract": "^1.18.0-next.0", "function-bind": "^1.1.1",
"has-symbols": "^1.0.1", "has-symbols": "^1.0.0",
"object-keys": "^1.1.1" "object-keys": "^1.0.11"
},
"dependencies": {
"es-abstract": {
"version": "1.18.0-next.1",
"resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.1.tgz",
"integrity": "sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA==",
"dev": true,
"requires": {
"es-to-primitive": "^1.2.1",
"function-bind": "^1.1.1",
"has": "^1.0.3",
"has-symbols": "^1.0.1",
"is-callable": "^1.2.2",
"is-negative-zero": "^2.0.0",
"is-regex": "^1.1.1",
"object-inspect": "^1.8.0",
"object-keys": "^1.1.1",
"object.assign": "^4.1.1",
"string.prototype.trimend": "^1.0.1",
"string.prototype.trimstart": "^1.0.1"
}
}
} }
}, },
"object.pick": { "object.pick": {
@@ -8135,74 +8107,58 @@
} }
}, },
"ts-jest": { "ts-jest": {
"version": "26.4.1", "version": "26.1.3",
"resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-26.4.1.tgz", "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-26.1.3.tgz",
"integrity": "sha512-F4aFq01aS6mnAAa0DljNmKr/Kk9y4HVZ1m6/rtJ0ED56cuxINGq3Q9eVAh+z5vcYKe5qnTMvv90vE8vUMFxomg==", "integrity": "sha512-beUTSvuqR9SmKQEylewqJdnXWMVGJRFqSz2M8wKJe7GBMmLZ5zw6XXKSJckbHNMxn+zdB3guN2eOucSw2gBMnw==",
"dev": true, "dev": true,
"requires": { "requires": {
"@types/jest": "26.x",
"bs-logger": "0.x", "bs-logger": "0.x",
"buffer-from": "1.x", "buffer-from": "1.x",
"fast-json-stable-stringify": "2.x", "fast-json-stable-stringify": "2.x",
"jest-util": "^26.1.0", "jest-util": "26.x",
"json5": "2.x", "json5": "2.x",
"lodash.memoize": "4.x", "lodash.memoize": "4.x",
"make-error": "1.x", "make-error": "1.x",
"mkdirp": "1.x", "mkdirp": "1.x",
"semver": "7.x", "semver": "7.x",
"yargs-parser": "20.x" "yargs-parser": "18.x"
}, },
"dependencies": { "dependencies": {
"@jest/types": { "@jest/types": {
"version": "25.5.0", "version": "26.1.0",
"resolved": "https://registry.npmjs.org/@jest/types/-/types-25.5.0.tgz", "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.1.0.tgz",
"integrity": "sha512-OXD0RgQ86Tu3MazKo8bnrkDRaDXXMGUqd+kTtLtK1Zb7CRzQcaSRPPPV37SvYTdevXEBVxe0HXylEjs8ibkmCw==", "integrity": "sha512-GXigDDsp6ZlNMhXQDeuy/iYCDsRIHJabWtDzvnn36+aqFfG14JmFV0e/iXxY4SP9vbXSiPNOWdehU5MeqrYHBQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"@types/istanbul-lib-coverage": "^2.0.0", "@types/istanbul-lib-coverage": "^2.0.0",
"@types/istanbul-reports": "^1.1.1", "@types/istanbul-reports": "^1.1.1",
"@types/yargs": "^15.0.0", "@types/yargs": "^15.0.0",
"chalk": "^3.0.0" "chalk": "^4.0.0"
}
},
"@types/jest": {
"version": "26.0.14",
"resolved": "https://registry.npmjs.org/@types/jest/-/jest-26.0.14.tgz",
"integrity": "sha512-Hz5q8Vu0D288x3iWXePSn53W7hAjP0H7EQ6QvDO9c7t46mR0lNOLlfuwQ+JkVxuhygHzlzPX+0jKdA3ZgSh+Vg==",
"dev": true,
"requires": {
"jest-diff": "^25.2.1",
"pretty-format": "^25.2.1"
} }
}, },
"@types/yargs": { "@types/yargs": {
"version": "15.0.7", "version": "15.0.5",
"resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.7.tgz", "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.5.tgz",
"integrity": "sha512-Gf4u3EjaPNcC9cTu4/j2oN14nSVhr8PQ+BvBcBQHAhDZfl0bVIiLgvnRXv/dn58XhTm9UXvBpvJpDlwV65QxOA==", "integrity": "sha512-Dk/IDOPtOgubt/IaevIUbTgV7doaKkoorvOyYM2CMwuDyP89bekI7H4xLIwunNYiK9jhCkmc6pUrJk3cj2AB9w==",
"dev": true, "dev": true,
"requires": { "requires": {
"@types/yargs-parser": "*" "@types/yargs-parser": "*"
} }
}, },
"ansi-regex": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz",
"integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==",
"dev": true
},
"ansi-styles": { "ansi-styles": {
"version": "4.3.0", "version": "4.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==",
"dev": true, "dev": true,
"requires": { "requires": {
"@types/color-name": "^1.1.1",
"color-convert": "^2.0.1" "color-convert": "^2.0.1"
} }
}, },
"chalk": { "chalk": {
"version": "3.0.0", "version": "4.1.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz",
"integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==",
"dev": true, "dev": true,
"requires": { "requires": {
"ansi-styles": "^4.1.0", "ansi-styles": "^4.1.0",
@@ -8224,82 +8180,23 @@
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true "dev": true
}, },
"diff-sequences": {
"version": "25.2.6",
"resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-25.2.6.tgz",
"integrity": "sha512-Hq8o7+6GaZeoFjtpgvRBUknSXNeJiCx7V9Fr94ZMljNiCr9n9L8H8aJqgWOQiDDGdyn29fRNcDdRVJ5fdyihfg==",
"dev": true
},
"has-flag": { "has-flag": {
"version": "4.0.0", "version": "4.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true "dev": true
}, },
"jest-diff": {
"version": "25.5.0",
"resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-25.5.0.tgz",
"integrity": "sha512-z1kygetuPiREYdNIumRpAHY6RXiGmp70YHptjdaxTWGmA085W3iCnXNx0DhflK3vwrKmrRWyY1wUpkPMVxMK7A==",
"dev": true,
"requires": {
"chalk": "^3.0.0",
"diff-sequences": "^25.2.6",
"jest-get-type": "^25.2.6",
"pretty-format": "^25.5.0"
}
},
"jest-get-type": {
"version": "25.2.6",
"resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-25.2.6.tgz",
"integrity": "sha512-DxjtyzOHjObRM+sM1knti6or+eOgcGU4xVSb2HNP1TqO4ahsT+rqZg+nyqHWJSvWgKC5cG3QjGFBqxLghiF/Ig==",
"dev": true
},
"jest-util": { "jest-util": {
"version": "26.5.2", "version": "26.1.0",
"resolved": "https://registry.npmjs.org/jest-util/-/jest-util-26.5.2.tgz", "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-26.1.0.tgz",
"integrity": "sha512-WTL675bK+GSSAYgS8z9FWdCT2nccO1yTIplNLPlP0OD8tUk/H5IrWKMMRudIQQ0qp8bb4k+1Qa8CxGKq9qnYdg==", "integrity": "sha512-rNMOwFQevljfNGvbzNQAxdmXQ+NawW/J72dmddsK0E8vgxXCMtwQ/EH0BiWEIxh0hhMcTsxwAxINt7Lh46Uzbg==",
"dev": true, "dev": true,
"requires": { "requires": {
"@jest/types": "^26.5.2", "@jest/types": "^26.1.0",
"@types/node": "*",
"chalk": "^4.0.0", "chalk": "^4.0.0",
"graceful-fs": "^4.2.4", "graceful-fs": "^4.2.4",
"is-ci": "^2.0.0", "is-ci": "^2.0.0",
"micromatch": "^4.0.2" "micromatch": "^4.0.2"
},
"dependencies": {
"@jest/types": {
"version": "26.5.2",
"resolved": "https://registry.npmjs.org/@jest/types/-/types-26.5.2.tgz",
"integrity": "sha512-QDs5d0gYiyetI8q+2xWdkixVQMklReZr4ltw7GFDtb4fuJIBCE6mzj2LnitGqCuAlLap6wPyb8fpoHgwZz5fdg==",
"dev": true,
"requires": {
"@types/istanbul-lib-coverage": "^2.0.0",
"@types/istanbul-reports": "^3.0.0",
"@types/node": "*",
"@types/yargs": "^15.0.0",
"chalk": "^4.0.0"
}
},
"@types/istanbul-reports": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.0.tgz",
"integrity": "sha512-nwKNbvnwJ2/mndE9ItP/zc2TCzw6uuodnF4EHYWD+gCQDVBuRQL5UzbZD0/ezy1iKsFU2ZQiDqg4M9dN4+wZgA==",
"dev": true,
"requires": {
"@types/istanbul-lib-report": "*"
}
},
"chalk": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz",
"integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==",
"dev": true,
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
}
} }
}, },
"json5": { "json5": {
@@ -8317,18 +8214,6 @@
"integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==",
"dev": true "dev": true
}, },
"pretty-format": {
"version": "25.5.0",
"resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-25.5.0.tgz",
"integrity": "sha512-kbo/kq2LQ/A/is0PQwsEHM7Ca6//bGPPvU6UnsdDRSKTWxT/ru/xb88v4BJf6a69H+uTytOEsTusT9ksd/1iWQ==",
"dev": true,
"requires": {
"@jest/types": "^25.5.0",
"ansi-regex": "^5.0.0",
"ansi-styles": "^4.0.0",
"react-is": "^16.12.0"
}
},
"semver": { "semver": {
"version": "7.3.2", "version": "7.3.2",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz",
@@ -8336,19 +8221,13 @@
"dev": true "dev": true
}, },
"supports-color": { "supports-color": {
"version": "7.2.0", "version": "7.1.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==",
"dev": true, "dev": true,
"requires": { "requires": {
"has-flag": "^4.0.0" "has-flag": "^4.0.0"
} }
},
"yargs-parser": {
"version": "20.2.1",
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.1.tgz",
"integrity": "sha512-yYsjuSkjbLMBp16eaOt7/siKTjNVjMm3SoJnIg3sEh/JsvqVVDyjRKmaJV4cl+lNIgq6QEco2i3gDebJl7/vLA==",
"dev": true
} }
} }
}, },
+5 -5
View File
@@ -21,24 +21,24 @@
"author": "Reactive Circus", "author": "Reactive Circus",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@actions/core": "^1.2.6", "@actions/core": "^1.2.4",
"@actions/exec": "^1.0.4", "@actions/exec": "^1.0.4",
"@actions/tool-cache": "^1.6.0", "@actions/tool-cache": "^1.6.0",
"minimist": "^1.2.5" "minimist": "^1.2.5"
}, },
"devDependencies": { "devDependencies": {
"@types/jest": "^24.9.1", "@types/jest": "^24.9.1",
"@types/node": "^12.12.64", "@types/node": "^12.12.50",
"@typescript-eslint/eslint-plugin": "^2.34.0", "@typescript-eslint/eslint-plugin": "^2.34.0",
"@typescript-eslint/parser": "^2.34.0", "@typescript-eslint/parser": "^2.34.0",
"eslint": "^6.8.0", "eslint": "^6.8.0",
"eslint-config-prettier": "^6.12.0", "eslint-config-prettier": "^6.11.0",
"eslint-plugin-import": "^2.22.1", "eslint-plugin-import": "^2.22.0",
"eslint-plugin-prettier": "^3.1.4", "eslint-plugin-prettier": "^3.1.4",
"jest": "^25.5.4", "jest": "^25.5.4",
"jest-circus": "^25.5.4", "jest-circus": "^25.5.4",
"prettier": "^1.19.1", "prettier": "^1.19.1",
"ts-jest": "^26.4.1", "ts-jest": "^26.1.3",
"typescript": "^3.9.7" "typescript": "^3.9.7"
} }
} }
+1 -1
View File
@@ -1,5 +1,5 @@
export const MIN_API_LEVEL = 15; export const MIN_API_LEVEL = 15;
export const VALID_TARGETS: Array<string> = ['default', 'google_apis', 'google_apis_playstore']; export const VALID_TARGETS: Array<string> = ['default', 'google_apis'];
export const VALID_ARCHS: Array<string> = ['x86', 'x86_64']; export const VALID_ARCHS: Array<string> = ['x86', 'x86_64'];
export function checkApiLevel(apiLevel: string): void { export function checkApiLevel(apiLevel: string): void {
+5 -11
View File
@@ -7,15 +7,10 @@ import { parseScript } from './script-parser';
async function run() { async function run() {
try { try {
// only support running on macOS or Linux if (process.platform === 'linux') {
if (process.platform !== 'darwin') { console.warn(
if (process.platform === 'linux') { `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.`
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 // API level of the platform and system image
@@ -25,8 +20,7 @@ async function run() {
console.log(`API level: ${apiLevel}`); console.log(`API level: ${apiLevel}`);
// target of the system image // target of the system image
const targetInput = core.getInput('target'); const target = core.getInput('target');
const target = targetInput == 'playstore' ? 'google_apis_playstore' : targetInput;
checkTarget(target); checkTarget(target);
console.log(`target: ${target}`); console.log(`target: ${target}`);
+20 -21
View File
@@ -5,40 +5,38 @@ import * as tc from '@actions/tool-cache';
import * as fs from 'fs'; import * as fs from 'fs';
const BUILD_TOOLS_VERSION = '30.0.2'; const BUILD_TOOLS_VERSION = '30.0.2';
const CMDLINE_TOOLS_URL_MAC = 'https://dl.google.com/android/repository/commandlinetools-mac-6858069_latest.zip'; const CMDLINE_TOOLS_URL_MAC = 'https://dl.google.com/android/repository/commandlinetools-mac-6609375_latest.zip';
const CMDLINE_TOOLS_URL_LINUX = 'https://dl.google.com/android/repository/commandlinetools-linux-6858069_latest.zip'; const CMDLINE_TOOLS_URL_WIN = 'https://dl.google.com/android/repository/commandlinetools-win-6609375_latest.zip';
const CMDLINE_TOOLS_URL_LINUX = 'https://dl.google.com/android/repository/commandlinetools-linux-6609375_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, * 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. * and the system image for the chosen API level, CPU arch, and target.
*/ */
export async function installAndroidSdk(apiLevel: number, target: string, arch: string, emulatorBuild?: string, ndkVersion?: string, cmakeVersion?: string): Promise<void> { export async function installAndroidSdk(apiLevel: number, target: string, arch: string, emulatorBuild?: string, ndkVersion?: string, cmakeVersion?: string): Promise<void> {
const isOnMac = process.platform === 'darwin'; const IS_MAC = process.platform === 'darwin';
const IS_WINDOWS = process.platform === 'win32';
const IS_LINUX = process.platform === 'linux';
if (!isOnMac) { if (IS_LINUX) {
await exec.exec(`sh -c \\"sudo chown $USER:$USER ${process.env.ANDROID_HOME} -R`); await exec.exec(`sh -c \\"sudo chown $USER:$USER ${process.env.ANDROID_HOME} -R`);
} }
const cmdlineToolsPath = `${process.env.ANDROID_HOME}/cmdline-tools`; const cmdlineToolsPath = `${process.env.ANDROID_HOME}/cmdline-tools`;
if (!fs.existsSync(cmdlineToolsPath)) { if (!fs.existsSync(cmdlineToolsPath)) {
console.log('Installing new cmdline-tools.'); console.log('Installing new cmdline-tools.');
const sdkUrl = isOnMac ? CMDLINE_TOOLS_URL_MAC : CMDLINE_TOOLS_URL_LINUX; await io.mkdirP(`${process.env.ANDROID_HOME}/cmdline-tools`);
// await io.mkdirP(cmdlineToolsPath); const sdkUrl = IS_MAC ? CMDLINE_TOOLS_URL_MAC : IS_WINDOWS ? CMDLINE_TOOLS_URL_WIN : CMDLINE_TOOLS_URL_LINUX;
const downloadPath = await tc.downloadTool(sdkUrl); const downloadPath = await tc.downloadTool(sdkUrl);
await tc.extractZip(downloadPath, cmdlineToolsPath); await tc.extractZip(downloadPath, cmdlineToolsPath);
await io.mv(`${cmdlineToolsPath}/cmdline-tools`, `${cmdlineToolsPath}/latest`);
await exec.exec(`ls -la ${cmdlineToolsPath}`);
// add paths for commandline-tools and platform-tools // add paths for commandline-tools and platform-tools
core.addPath(`${cmdlineToolsPath}/latest:${cmdlineToolsPath}/latest/bin:${process.env.ANDROID_HOME}/platform-tools`); core.addPath(`${cmdlineToolsPath}/tools:${cmdlineToolsPath}/tools/bin:${process.env.ANDROID_HOME}/platform-tools`);
await exec.exec(`ls -la ${cmdlineToolsPath}/latest`);
} }
// additional permission and license requirements for Linux // additional permission and license requirements for Linux
const sdkPreviewLicensePath = `${process.env.ANDROID_HOME}/licenses/android-sdk-preview-license`; const sdkPreviewLicensePath = `${process.env.ANDROID_HOME}/licenses/android-sdk-preview-license`;
if (!isOnMac && !fs.existsSync(sdkPreviewLicensePath)) { if (IS_LINUX && !fs.existsSync(sdkPreviewLicensePath)) {
fs.writeFileSync(sdkPreviewLicensePath, '\n84831b9409646a918e30573bab4c9c91346d8abd'); fs.writeFileSync(sdkPreviewLicensePath, '\n84831b9409646a918e30573bab4c9c91346d8abd');
} }
@@ -50,26 +48,27 @@ export async function installAndroidSdk(apiLevel: number, target: string, arch:
console.log('Installing latest build tools, platform tools, and platform.'); console.log('Installing latest build tools, platform tools, and platform.');
await exec.exec(`sh -c \\"sdkmanager --install 'build-tools;${BUILD_TOOLS_VERSION}' platform-tools 'platforms;android-${apiLevel}' > /dev/null"`); const sdkmanagerExec = IS_WINDOWS ? 'sdkmanager.bat' : 'sdkmanager';
await exec.exec(`sh -c \\"${sdkmanagerExec} --install 'build-tools;${BUILD_TOOLS_VERSION}' platform-tools 'platforms;android-${apiLevel}' > /dev/null"`);
if (emulatorBuild) { if (emulatorBuild) {
console.log(`Installing emulator build ${emulatorBuild}.`); console.log(`Installing emulator build ${emulatorBuild}.`);
await exec.exec(`curl -fo emulator.zip https://dl.google.com/android/repository/emulator-${isOnMac ? 'darwin' : 'linux'}-${emulatorBuild}.zip`);
await io.rmRF(`${process.env.ANDROID_HOME}/emulator`); await io.rmRF(`${process.env.ANDROID_HOME}/emulator`);
await exec.exec(`unzip -q emulator.zip -d ${process.env.ANDROID_HOME}`); const downloadPath = await tc.downloadTool(`https://dl.google.com/android/repository/emulator-${IS_MAC ? 'darwin' : IS_WINDOWS ? 'windows' : 'linux'}-${emulatorBuild}.zip`);
await io.rmRF('emulator.zip'); await tc.extractZip(downloadPath, process.env.ANDROID_HOME);
} else { } else {
console.log('Installing latest emulator.'); console.log('Installing latest emulator.');
await exec.exec(`sh -c \\"sdkmanager --install emulator > /dev/null"`); await exec.exec(`sh -c \\"${sdkmanagerExec} --install emulator > /dev/null"`);
} }
console.log('Installing system images.'); console.log('Installing system images.');
await exec.exec(`sh -c \\"sdkmanager --install 'system-images;android-${apiLevel};${target};${arch}' > /dev/null"`); await exec.exec(`sh -c \\"${sdkmanagerExec} --install 'system-images;android-${apiLevel};${target};${arch}' > /dev/null"`);
if (ndkVersion) { if (ndkVersion) {
console.log(`Installing NDK ${ndkVersion}.`); console.log(`Installing NDK ${ndkVersion}.`);
await exec.exec(`sh -c \\"sdkmanager --install 'ndk;${ndkVersion}' > /dev/null"`); await exec.exec(`sh -c \\"${sdkmanagerExec} --install 'ndk;${ndkVersion}' > /dev/null"`);
} }
if (cmakeVersion) { if (cmakeVersion) {
console.log(`Installing CMake ${cmakeVersion}.`); console.log(`Installing CMake ${cmakeVersion}.`);
await exec.exec(`sh -c \\"sdkmanager --install 'cmake;${cmakeVersion}' > /dev/null"`); await exec.exec(`sh -c \\"${sdkmanagerExec} --install 'cmake;${cmakeVersion}' > /dev/null"`);
} }
} }
-1
View File
@@ -1,7 +1,6 @@
org.gradle.parallel=true org.gradle.parallel=true
org.gradle.configureondemand=true org.gradle.configureondemand=true
org.gradle.caching=true org.gradle.caching=true
org.gradle.vfs.watch=true
# Enable Kotlin incremental compilation # Enable Kotlin incremental compilation
kotlin.incremental=true kotlin.incremental=true
+1 -1
View File
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-6.6-all.zip