diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ce578541a..ce726b715 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,6 +22,7 @@ jobs: api-level: [16, 23, 29] target: [default, google_apis] arch: [x86] + profile: ["Galaxy Nexus"] exclude: - os: ubuntu-latest api-level: 23 @@ -38,14 +39,22 @@ jobs: api-level: 24 target: playstore arch: x86 + profile: "Galaxy Nexus" - os: macos-latest api-level: 30 target: aosp_atd arch: x86 + profile: "Galaxy Nexus" - os: macos-11 api-level: 31 target: google_apis arch: x86_64 + profile: "Galaxy Nexus" + - os: macos-latest + api-level: 32 + target: android-desktop + arch: x86_64 + profile: "desktop_medium" steps: - name: checkout @@ -73,7 +82,7 @@ jobs: ~/.android/avd/* ~/.android/adb* ~/.android/debug.keystore - key: avd-${{ matrix.api-level }}-${{ matrix.os }}-${{ matrix.target }} + key: avd-${{ matrix.api-level }}-${{ matrix.os }}-${{ matrix.target }}-${{ matrix.profile }} - name: assemble tests uses: gradle/gradle-build-action@v2 @@ -88,7 +97,7 @@ jobs: api-level: ${{ matrix.api-level }} target: ${{ matrix.target }} arch: ${{ matrix.arch }} - profile: Galaxy Nexus + profile: ${{ matrix.profile }} cores: 2 sdcard-path-or-size: 100M avd-name: test @@ -105,7 +114,7 @@ jobs: api-level: ${{ matrix.api-level }} target: ${{ matrix.target }} arch: ${{ matrix.arch }} - profile: Galaxy Nexus + profile: ${{ matrix.profile }} cores: 2 ram-size: 2048M sdcard-path-or-size: 100M diff --git a/README.md b/README.md index 325e58ee6..b772cdb12 100644 --- a/README.md +++ b/README.md @@ -144,7 +144,7 @@ jobs: | **Input** | **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**. | -| `target` | Optional | `default` | Target of the system image - `default`, `google_apis`, `playstore`, `android-wear`, `android-wear-cn`, `android-tv`, `google-tv`, `aosp_atd` or `google_atd`. Note that `aosp_atd` and `google_atd` currently require the following: `api-level: 30`, `arch: x86` or `arch: arm64-v8` and `channel: canary`. | +| `target` | Optional | `default` | Target of the system image - `default`, `google_apis`, `playstore`, `android-wear`, `android-wear-cn`, `android-tv`, `google-tv`, `android-desktop`, `aosp_atd` or `google_atd`. Note that `aosp_atd` and `google_atd` currently require the following: `api-level: 30`, `arch: x86` or `arch: arm64-v8` and `channel: canary`. | | `arch` | Optional | `x86` | CPU architecture of the system image - `x86`, `x86_64` or `arm64-v8a`. Note that `x86_64` image is only available for API 21+. `arm64-v8a` images require Android 4.2+ and are limited to fewer API levels (e.g. 30). | | `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 device`. | | `cores` | Optional | 2 | Number of cores to use for the emulator (`hw.cpu.ncore` in config.ini). | diff --git a/__tests__/input-validator.test.ts b/__tests__/input-validator.test.ts index ba7e20eb4..f0fc6685d 100644 --- a/__tests__/input-validator.test.ts +++ b/__tests__/input-validator.test.ts @@ -88,6 +88,11 @@ describe('target validator tests', () => { validator.checkTarget('google-tv'); }; expect(func9).not.toThrow(); + + const func10 = () => { + validator.checkTarget('android-desktop'); + }; + expect(func10).not.toThrow(); }); }); diff --git a/action.yml b/action.yml index 13ba8e368..ca827ddb6 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, aosp_atd, google_atd, 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, google-tv or android-desktop' default: 'default' arch: description: 'CPU architecture of the system image - x86, x86_64 or arm64-v8a' diff --git a/src/input-validator.ts b/src/input-validator.ts index 7cf1e1b04..ac636d14e 100644 --- a/src/input-validator.ts +++ b/src/input-validator.ts @@ -1,5 +1,16 @@ export const MIN_API_LEVEL = 15; -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_TARGETS: Array = [ + 'default', + 'google_apis', + 'aosp_atd', + 'google_atd', + 'google_apis_playstore', + 'android-wear', + 'android-wear-cn', + 'android-tv', + 'google-tv', + 'android-desktop', +]; export const VALID_ARCHS: Array = ['x86', 'x86_64', 'arm64-v8a']; export const VALID_CHANNELS: Array = ['stable', 'beta', 'dev', 'canary'];