Skip to content

Commit b306512

Browse files
committed
Add android-desktop target option
1 parent e1248ae commit b306512

File tree

5 files changed

+31
-6
lines changed

5 files changed

+31
-6
lines changed

.github/workflows/main.yml

+12-3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jobs:
2222
api-level: [16, 23, 29]
2323
target: [default, google_apis]
2424
arch: [x86]
25+
profile: ["Galaxy Nexus"]
2526
exclude:
2627
- os: ubuntu-latest
2728
api-level: 23
@@ -38,14 +39,22 @@ jobs:
3839
api-level: 24
3940
target: playstore
4041
arch: x86
42+
profile: "Galaxy Nexus"
4143
- os: macos-latest
4244
api-level: 30
4345
target: aosp_atd
4446
arch: x86
47+
profile: "Galaxy Nexus"
4548
- os: macos-11
4649
api-level: 31
4750
target: google_apis
4851
arch: x86_64
52+
profile: "Galaxy Nexus"
53+
- os: macos-latest
54+
api-level: 32
55+
target: android-desktop
56+
arch: x86_64
57+
profile: "Medium Desktop"
4958

5059
steps:
5160
- name: checkout
@@ -73,7 +82,7 @@ jobs:
7382
~/.android/avd/*
7483
~/.android/adb*
7584
~/.android/debug.keystore
76-
key: avd-${{ matrix.api-level }}-${{ matrix.os }}-${{ matrix.target }}
85+
key: avd-${{ matrix.api-level }}-${{ matrix.os }}-${{ matrix.target }}-${{ matrix.profile }}
7786

7887
- name: assemble tests
7988
uses: gradle/gradle-build-action@v2
@@ -88,7 +97,7 @@ jobs:
8897
api-level: ${{ matrix.api-level }}
8998
target: ${{ matrix.target }}
9099
arch: ${{ matrix.arch }}
91-
profile: Galaxy Nexus
100+
profile: ${{ matrix.profile }}
92101
cores: 2
93102
sdcard-path-or-size: 100M
94103
avd-name: test
@@ -105,7 +114,7 @@ jobs:
105114
api-level: ${{ matrix.api-level }}
106115
target: ${{ matrix.target }}
107116
arch: ${{ matrix.arch }}
108-
profile: Galaxy Nexus
117+
profile: ${{ matrix.profile }}
109118
cores: 2
110119
ram-size: 2048M
111120
sdcard-path-or-size: 100M

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ jobs:
144144
| **Input** | **Required** | **Default** | **Description** |
145145
|-|-|-|-|
146146
| `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**. |
147-
| `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`. |
147+
| `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`. |
148148
| `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). |
149149
| `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`. |
150150
| `cores` | Optional | 2 | Number of cores to use for the emulator (`hw.cpu.ncore` in config.ini). |

__tests__/input-validator.test.ts

+5
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ describe('target validator tests', () => {
8888
validator.checkTarget('google-tv');
8989
};
9090
expect(func9).not.toThrow();
91+
92+
const func10 = () => {
93+
validator.checkTarget('android-desktop');
94+
};
95+
expect(func10).not.toThrow();
9196
});
9297
});
9398

action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ inputs:
99
description: 'API level of the platform and system image - e.g. 23 for Android Marshmallow, 29 for Android 10'
1010
required: true
1111
target:
12-
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'
12+
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'
1313
default: 'default'
1414
arch:
1515
description: 'CPU architecture of the system image - x86, x86_64 or arm64-v8a'

src/input-validator.ts

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
export const MIN_API_LEVEL = 15;
2-
export const VALID_TARGETS: Array<string> = ['default', 'google_apis', 'aosp_atd', 'google_atd', 'google_apis_playstore', 'android-wear', 'android-wear-cn', 'android-tv', 'google-tv'];
2+
export const VALID_TARGETS: Array<string> = [
3+
'default',
4+
'google_apis',
5+
'aosp_atd',
6+
'google_atd',
7+
'google_apis_playstore',
8+
'android-wear',
9+
'android-wear-cn',
10+
'android-tv',
11+
'google-tv',
12+
'android-desktop',
13+
];
314
export const VALID_ARCHS: Array<string> = ['x86', 'x86_64', 'arm64-v8a'];
415
export const VALID_CHANNELS: Array<string> = ['stable', 'beta', 'dev', 'canary'];
516

0 commit comments

Comments
 (0)