Skip to content

Commit 77986be

Browse files
committed
Merge branch 'main' into release/v2
* main: Prepare for release 2.31.0. Install platforms for the specified api level (#384) Add api level `VanillaIceCream` support (#378) Bump Gradle wrapper validation from v1 to v2 to use Node 20 (#374) Migrate to Node 20 on CI via GitHub Actions major upgrades (#372)
2 parents 6b0df4b + ca77a10 commit 77986be

File tree

9 files changed

+33
-26
lines changed

9 files changed

+33
-26
lines changed

.github/workflows/action-types.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ jobs:
99
validate-typings:
1010
runs-on: "ubuntu-latest"
1111
steps:
12-
- uses: actions/checkout@v3
12+
- uses: actions/checkout@v4
1313
- uses: krzema12/github-actions-typing@v0

.github/workflows/main.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ jobs:
4949

5050
steps:
5151
- name: checkout
52-
uses: actions/checkout@v3
52+
uses: actions/checkout@v4
5353

5454
- name: validate gradle wrapper
55-
uses: gradle/wrapper-validation-action@v1
55+
uses: gradle/wrapper-validation-action@v2
5656

5757
- name: build, test and lint
5858
run: |
@@ -61,12 +61,12 @@ jobs:
6161
npm run lint
6262
npm test
6363
64-
- uses: actions/setup-java@v3
64+
- uses: actions/setup-java@v4
6565
with:
6666
distribution: 'zulu'
6767
java-version: 21
6868

69-
- uses: actions/cache@v3
69+
- uses: actions/cache@v4
7070
id: avd-cache
7171
with:
7272
path: |
@@ -75,11 +75,11 @@ jobs:
7575
~/.android/debug.keystore
7676
key: avd-${{ matrix.api-level }}-${{ matrix.os }}-${{ matrix.target }}
7777

78+
- uses: gradle/actions/setup-gradle@v3
79+
7880
- name: assemble tests
79-
uses: gradle/gradle-build-action@v2
80-
with:
81-
build-root-directory: test-fixture
82-
arguments: assembleAndroidTest
81+
working-directory: test-fixture
82+
run: ./gradlew assembleAndroidTest
8383

8484
- name: enable KVM for linux runners
8585
if: runner.os == 'Linux'

.github/workflows/manually.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ jobs:
3939

4040
steps:
4141
- name: checkout
42-
uses: actions/checkout@v3
42+
uses: actions/checkout@v4
4343

4444
- name: validate gradle wrapper
45-
uses: gradle/wrapper-validation-action@v1
45+
uses: gradle/wrapper-validation-action@v2
4646

4747
- name: build, test and lint
4848
run: |
@@ -51,12 +51,12 @@ jobs:
5151
npm run lint
5252
npm test
5353
54-
- uses: actions/setup-java@v3
54+
- uses: actions/setup-java@v4
5555
with:
5656
distribution: 'zulu'
5757
java-version: 21
5858

59-
- uses: gradle/gradle-build-action@v2
59+
- uses: gradle/actions/setup-gradle@v3
6060
with:
6161
gradle-home-cache-cleanup: true
6262

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Change Log
22

3+
## v2.31.0
4+
5+
* Support setting `VanillaIceCream` as `api-level`. - [#378](https://github.com/ReactiveCircus/android-emulator-runner/pull/378)
6+
* Install `platforms` for the specified `api-level`. - [#384](https://github.com/ReactiveCircus/android-emulator-runner/pull/384)
7+
38
## v2.30.1
49

510
* Run action on Node 20. - [#371](https://github.com/ReactiveCircus/android-emulator-runner/pull/371)

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
runs-on: ubuntu-latest
5050
steps:
5151
- name: checkout
52-
uses: actions/checkout@v3
52+
uses: actions/checkout@v4
5353

5454
- name: Enable KVM
5555
run: |
@@ -76,7 +76,7 @@ jobs:
7676
target: [default, google_apis]
7777
steps:
7878
- name: checkout
79-
uses: actions/checkout@v3
79+
uses: actions/checkout@v4
8080

8181
- name: Enable KVM
8282
run: |
@@ -102,7 +102,7 @@ jobs:
102102
runs-on: ubuntu-latest
103103
steps:
104104
- name: checkout
105-
uses: actions/checkout@v3
105+
uses: actions/checkout@v4
106106

107107
- name: Enable KVM
108108
run: |
@@ -121,8 +121,8 @@ jobs:
121121
122122
We can significantly reduce emulator startup time by setting up AVD snapshot caching:
123123
124-
1. add a `gradle/gradle-build-action@v2` step for caching Gradle, more details see [#229](https://github.com/ReactiveCircus/android-emulator-runner/issues/229)
125-
2. add an `actions/cache@v3` step for caching the `avd`
124+
1. add a `gradle/actions/setup-gradle@v3` step for caching Gradle, more details see [#229](https://github.com/ReactiveCircus/android-emulator-runner/issues/229)
125+
2. add an `actions/cache@v4` step for caching the `avd`
126126
3. add a `reactivecircus/android-emulator-runner@v2` step to generate a clean snapshot - specify `emulator-options` without `no-snapshot`
127127
4. add another `reactivecircus/android-emulator-runner@v2` step to run your tests using existing AVD / snapshot - specify `emulator-options` with `no-snapshot-save`
128128

@@ -135,7 +135,7 @@ jobs:
135135
api-level: [21, 23, 29]
136136
steps:
137137
- name: checkout
138-
uses: actions/checkout@v3
138+
uses: actions/checkout@v4
139139
140140
- name: Enable KVM
141141
run: |
@@ -144,10 +144,10 @@ jobs:
144144
sudo udevadm trigger --name-match=kvm
145145
146146
- name: Gradle cache
147-
uses: gradle/gradle-build-action@v2
147+
uses: gradle/actions/setup-gradle@v3
148148
149149
- name: AVD cache
150-
uses: actions/cache@v3
150+
uses: actions/cache@v4
151151
id: avd-cache
152152
with:
153153
path: |

lib/input-validator.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
"use strict";
22
Object.defineProperty(exports, "__esModule", { value: true });
3-
exports.checkDiskSize = exports.checkEmulatorBuild = exports.checkEnableHardwareKeyboard = 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;
3+
exports.checkDiskSize = exports.checkEmulatorBuild = exports.checkEnableHardwareKeyboard = exports.checkDisableLinuxHardwareAcceleration = exports.checkDisableSpellchecker = exports.checkDisableAnimations = exports.checkForceAvdCreation = exports.checkChannel = exports.checkArch = exports.checkTarget = exports.checkApiLevel = exports.PREVIEW_API_LEVELS = exports.VALID_CHANNELS = exports.VALID_ARCHS = exports.VALID_TARGETS = exports.MIN_API_LEVEL = void 0;
44
exports.MIN_API_LEVEL = 15;
55
exports.VALID_TARGETS = ['default', 'google_apis', 'aosp_atd', 'google_atd', 'google_apis_playstore', 'android-wear', 'android-wear-cn', 'android-tv', 'google-tv'];
66
exports.VALID_ARCHS = ['x86', 'x86_64', 'arm64-v8a'];
77
exports.VALID_CHANNELS = ['stable', 'beta', 'dev', 'canary'];
8+
exports.PREVIEW_API_LEVELS = ['Tiramisu', 'UpsideDownCake', 'VanillaIceCream'];
89
function checkApiLevel(apiLevel) {
9-
if (apiLevel.startsWith('UpsideDownCake') || apiLevel === 'TiramisuPrivacySandbox')
10+
if (exports.PREVIEW_API_LEVELS.some((previewLevel) => apiLevel.startsWith(previewLevel)))
1011
return;
1112
if (isNaN(Number(apiLevel)) || !Number.isInteger(Number(apiLevel))) {
1213
throw new Error(`Unexpected API level: '${apiLevel}'.`);

lib/sdk-installer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ function installAndroidSdk(apiLevel, target, arch, channelId, emulatorBuild, ndk
7070
// accept all Android SDK licenses
7171
yield exec.exec(`sh -c \\"yes | sdkmanager --licenses > /dev/null"`);
7272
console.log('Installing latest build tools, platform tools, and platform.');
73-
yield exec.exec(`sh -c \\"sdkmanager --install 'build-tools;${BUILD_TOOLS_VERSION}' platform-tools > /dev/null"`);
73+
yield exec.exec(`sh -c \\"sdkmanager --install 'build-tools;${BUILD_TOOLS_VERSION}' platform-tools 'platforms;android-${apiLevel}'> /dev/null"`);
7474
console.log('Installing latest emulator.');
7575
yield exec.exec(`sh -c \\"sdkmanager --install emulator --channel=${channelId} > /dev/null"`);
7676
if (emulatorBuild) {

src/input-validator.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ export const MIN_API_LEVEL = 15;
22
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'];
33
export const VALID_ARCHS: Array<string> = ['x86', 'x86_64', 'arm64-v8a'];
44
export const VALID_CHANNELS: Array<string> = ['stable', 'beta', 'dev', 'canary'];
5+
export const PREVIEW_API_LEVELS: Array<string> = ['Tiramisu', 'UpsideDownCake', 'VanillaIceCream'];
56

67
export function checkApiLevel(apiLevel: string): void {
7-
if (apiLevel.startsWith('UpsideDownCake') || apiLevel === 'TiramisuPrivacySandbox') return;
8+
if (PREVIEW_API_LEVELS.some((previewLevel) => apiLevel.startsWith(previewLevel))) return;
89
if (isNaN(Number(apiLevel)) || !Number.isInteger(Number(apiLevel))) {
910
throw new Error(`Unexpected API level: '${apiLevel}'.`);
1011
}

src/sdk-installer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export async function installAndroidSdk(apiLevel: string, target: string, arch:
4343

4444
console.log('Installing latest build tools, platform tools, and platform.');
4545

46-
await exec.exec(`sh -c \\"sdkmanager --install 'build-tools;${BUILD_TOOLS_VERSION}' platform-tools > /dev/null"`);
46+
await exec.exec(`sh -c \\"sdkmanager --install 'build-tools;${BUILD_TOOLS_VERSION}' platform-tools 'platforms;android-${apiLevel}'> /dev/null"`);
4747

4848
console.log('Installing latest emulator.');
4949
await exec.exec(`sh -c \\"sdkmanager --install emulator --channel=${channelId} > /dev/null"`);

0 commit comments

Comments
 (0)