From 8f0c30aea25d737926fedb8cef84acbcac07fc0b Mon Sep 17 00:00:00 2001 From: Yang Date: Sat, 23 Oct 2021 19:11:16 +1100 Subject: [PATCH] Support aosp_atd and google_atd targets. --- .github/workflows/main.yml | 6 ++++-- .github/workflows/manually.yml | 2 +- __tests__/input-validator.test.ts | 20 +++++++++++++++----- action.yml | 2 +- lib/input-validator.js | 2 +- src/input-validator.ts | 2 +- 6 files changed, 23 insertions(+), 11 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e03f8f76..c2dee978 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -38,8 +38,8 @@ jobs: target: playstore arch: x86 - os: macos-latest - api-level: 28 - target: google_apis + api-level: 30 + target: aosp_atd arch: x86 - os: macos-11 api-level: 31 @@ -99,6 +99,7 @@ jobs: emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none disable-animations: false working-directory: ./test-fixture/ + channel: canary script: echo "Generated AVD snapshot for caching." - name: run action @@ -116,6 +117,7 @@ jobs: emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none disable-animations: true working-directory: ./test-fixture/ + channel: canary script: | echo $GITHUB_REPOSITORY adb devices diff --git a/.github/workflows/manually.yml b/.github/workflows/manually.yml index 3b438165..3f7da86b 100644 --- a/.github/workflows/manually.yml +++ b/.github/workflows/manually.yml @@ -11,7 +11,7 @@ on: required: true default: '30' target: - description: 'target of the system image - default, google_apis, google_apis_playstore, android-wear, android-wear-cn, android-tv or google-tv' + description: 'target of the system image - default, google_apis, google_apis_playstore, aosp_atd, google_atd, android-wear, android-wear-cn, android-tv or google-tv' required: true default: 'default' arch: diff --git a/__tests__/input-validator.test.ts b/__tests__/input-validator.test.ts index a5a2a22d..d861c58d 100644 --- a/__tests__/input-validator.test.ts +++ b/__tests__/input-validator.test.ts @@ -55,29 +55,39 @@ describe('target validator tests', () => { expect(func2).not.toThrow(); const func3 = () => { - validator.checkTarget('google_apis_playstore'); + validator.checkTarget('aosp_atd'); }; expect(func3).not.toThrow(); const func4 = () => { - validator.checkTarget('android-wear'); + validator.checkTarget('google_atd'); }; expect(func4).not.toThrow(); const func5 = () => { - validator.checkTarget('android-wear-cn'); + validator.checkTarget('google_apis_playstore'); }; expect(func5).not.toThrow(); const func6 = () => { - validator.checkTarget('android-tv'); + validator.checkTarget('android-wear'); }; expect(func6).not.toThrow(); const func7 = () => { - validator.checkTarget('google-tv'); + validator.checkTarget('android-wear-cn'); }; expect(func7).not.toThrow(); + + const func8 = () => { + validator.checkTarget('android-tv'); + }; + expect(func8).not.toThrow(); + + const func9 = () => { + validator.checkTarget('google-tv'); + }; + expect(func9).not.toThrow(); }); }); diff --git a/action.yml b/action.yml index 1ffadf86..704386c3 100644 --- a/action.yml +++ b/action.yml @@ -9,7 +9,7 @@ inputs: description: 'API level of the platform and system image - e.g. 23 for Android Marshmallow, 29 for Android 10' required: true target: - description: 'target of the system image - default, google_apis, google_apis_playstore, android-wear, android-wear-cn, android-tv or google-tv' + description: 'target of the system image - default, google_apis, google_apis_playstore, aosp_atd, google_atd, android-wear, android-wear-cn, android-tv or google-tv' default: 'default' arch: description: 'CPU architecture of the system image - x86, x86_64 or arm64-v8a' diff --git a/lib/input-validator.js b/lib/input-validator.js index b069cc95..69c53f29 100644 --- a/lib/input-validator.js +++ b/lib/input-validator.js @@ -2,7 +2,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.checkEmulatorBuild = exports.checkDisableLinuxHardwareAcceleration = exports.checkDisableSpellchecker = exports.checkDisableAnimations = exports.checkForceAvdCreation = exports.checkChannel = exports.checkArch = exports.checkTarget = exports.checkApiLevel = exports.VALID_CHANNELS = exports.VALID_ARCHS = exports.VALID_TARGETS = exports.MIN_API_LEVEL = void 0; exports.MIN_API_LEVEL = 15; -exports.VALID_TARGETS = ['default', 'google_apis', 'google_apis_playstore', 'android-wear', 'android-wear-cn', 'android-tv', 'google-tv']; +exports.VALID_TARGETS = ['default', 'google_apis', 'aosp_atd', 'google_atd', 'google_apis_playstore', 'android-wear', 'android-wear-cn', 'android-tv', 'google-tv']; exports.VALID_ARCHS = ['x86', 'x86_64', 'arm64-v8a']; exports.VALID_CHANNELS = ['stable', 'beta', 'dev', 'canary']; function checkApiLevel(apiLevel) { diff --git a/src/input-validator.ts b/src/input-validator.ts index fabf61b9..939c673f 100644 --- a/src/input-validator.ts +++ b/src/input-validator.ts @@ -1,5 +1,5 @@ export const MIN_API_LEVEL = 15; -export const VALID_TARGETS: Array = ['default', 'google_apis', 'google_apis_playstore', 'android-wear', 'android-wear-cn', 'android-tv', 'google-tv']; +export const VALID_TARGETS: Array = ['default', 'google_apis', 'aosp_atd', 'google_atd', 'google_apis_playstore', 'android-wear', 'android-wear-cn', 'android-tv', 'google-tv']; export const VALID_ARCHS: Array = ['x86', 'x86_64', 'arm64-v8a']; export const VALID_CHANNELS: Array = ['stable', 'beta', 'dev', 'canary'];