From 9d5d6236f44d786bfff168e4c7a2d1a2d16f0c6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B3bert=20Papp?= Date: Sat, 27 Jan 2024 12:11:47 +0000 Subject: [PATCH 1/5] Migrate to Node 20 on CI via GitHub Actions major upgrades (#372) * Update first party actions to Node 20 majors. * Update Gradle cache actions to Node 20 majors. --- .github/workflows/action-types.yml | 2 +- .github/workflows/main.yml | 14 +++++++------- .github/workflows/manually.yml | 6 +++--- README.md | 16 ++++++++-------- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/workflows/action-types.yml b/.github/workflows/action-types.yml index 90f969154..ad67c62dd 100644 --- a/.github/workflows/action-types.yml +++ b/.github/workflows/action-types.yml @@ -9,5 +9,5 @@ jobs: validate-typings: runs-on: "ubuntu-latest" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: krzema12/github-actions-typing@v0 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 43170a6b6..30e85bcf3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -49,7 +49,7 @@ jobs: steps: - name: checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: validate gradle wrapper uses: gradle/wrapper-validation-action@v1 @@ -61,12 +61,12 @@ jobs: npm run lint npm test - - uses: actions/setup-java@v3 + - uses: actions/setup-java@v4 with: distribution: 'zulu' java-version: 21 - - uses: actions/cache@v3 + - uses: actions/cache@v4 id: avd-cache with: path: | @@ -75,11 +75,11 @@ jobs: ~/.android/debug.keystore key: avd-${{ matrix.api-level }}-${{ matrix.os }}-${{ matrix.target }} + - uses: gradle/actions/setup-gradle@v3 + - name: assemble tests - uses: gradle/gradle-build-action@v2 - with: - build-root-directory: test-fixture - arguments: assembleAndroidTest + working-directory: test-fixture + run: ./gradlew assembleAndroidTest - name: enable KVM for linux runners if: runner.os == 'Linux' diff --git a/.github/workflows/manually.yml b/.github/workflows/manually.yml index 753b86a59..6b2e51102 100644 --- a/.github/workflows/manually.yml +++ b/.github/workflows/manually.yml @@ -39,7 +39,7 @@ jobs: steps: - name: checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: validate gradle wrapper uses: gradle/wrapper-validation-action@v1 @@ -51,12 +51,12 @@ jobs: npm run lint npm test - - uses: actions/setup-java@v3 + - uses: actions/setup-java@v4 with: distribution: 'zulu' java-version: 21 - - uses: gradle/gradle-build-action@v2 + - uses: gradle/actions/setup-gradle@v3 with: gradle-home-cache-cleanup: true diff --git a/README.md b/README.md index d1b1871f5..15a44b9a5 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ jobs: runs-on: ubuntu-latest steps: - name: checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Enable KVM run: | @@ -76,7 +76,7 @@ jobs: target: [default, google_apis] steps: - name: checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Enable KVM run: | @@ -102,7 +102,7 @@ jobs: runs-on: ubuntu-latest steps: - name: checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Enable KVM run: | @@ -121,8 +121,8 @@ jobs: We can significantly reduce emulator startup time by setting up AVD snapshot caching: -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) -2. add an `actions/cache@v3` step for caching the `avd` +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) +2. add an `actions/cache@v4` step for caching the `avd` 3. add a `reactivecircus/android-emulator-runner@v2` step to generate a clean snapshot - specify `emulator-options` without `no-snapshot` 4. add another `reactivecircus/android-emulator-runner@v2` step to run your tests using existing AVD / snapshot - specify `emulator-options` with `no-snapshot-save` @@ -135,7 +135,7 @@ jobs: api-level: [21, 23, 29] steps: - name: checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Enable KVM run: | @@ -144,10 +144,10 @@ jobs: sudo udevadm trigger --name-match=kvm - name: Gradle cache - uses: gradle/gradle-build-action@v2 + uses: gradle/actions/setup-gradle@v3 - name: AVD cache - uses: actions/cache@v3 + uses: actions/cache@v4 id: avd-cache with: path: | From a0c0e7216b96d46a893deeb10fdd24eb890411fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B3bert=20Papp?= Date: Mon, 29 Jan 2024 21:34:22 +0000 Subject: [PATCH 2/5] Bump Gradle wrapper validation from v1 to v2 to use Node 20 (#374) --- .github/workflows/main.yml | 2 +- .github/workflows/manually.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 30e85bcf3..cbeaa2288 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -52,7 +52,7 @@ jobs: uses: actions/checkout@v4 - name: validate gradle wrapper - uses: gradle/wrapper-validation-action@v1 + uses: gradle/wrapper-validation-action@v2 - name: build, test and lint run: | diff --git a/.github/workflows/manually.yml b/.github/workflows/manually.yml index 6b2e51102..9b8f9722a 100644 --- a/.github/workflows/manually.yml +++ b/.github/workflows/manually.yml @@ -42,7 +42,7 @@ jobs: uses: actions/checkout@v4 - name: validate gradle wrapper - uses: gradle/wrapper-validation-action@v1 + uses: gradle/wrapper-validation-action@v2 - name: build, test and lint run: | From d8da5b6410db6b047b0186ef624563bb2cd113e6 Mon Sep 17 00:00:00 2001 From: LoveSy Date: Sun, 18 Feb 2024 07:14:24 +0800 Subject: [PATCH 3/5] Add api level `VanillaIceCream` support (#378) --- lib/input-validator.js | 5 +++-- src/input-validator.ts | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/input-validator.js b/lib/input-validator.js index 783935843..9a26a4070 100644 --- a/lib/input-validator.js +++ b/lib/input-validator.js @@ -1,12 +1,13 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -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; +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; exports.MIN_API_LEVEL = 15; 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']; +exports.PREVIEW_API_LEVELS = ['Tiramisu', 'UpsideDownCake', 'VanillaIceCream']; function checkApiLevel(apiLevel) { - if (apiLevel.startsWith('UpsideDownCake') || apiLevel === 'TiramisuPrivacySandbox') + if (exports.PREVIEW_API_LEVELS.some((previewLevel) => apiLevel.startsWith(previewLevel))) return; if (isNaN(Number(apiLevel)) || !Number.isInteger(Number(apiLevel))) { throw new Error(`Unexpected API level: '${apiLevel}'.`); diff --git a/src/input-validator.ts b/src/input-validator.ts index e52d7923b..1a3bb217d 100644 --- a/src/input-validator.ts +++ b/src/input-validator.ts @@ -2,9 +2,10 @@ 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_ARCHS: Array = ['x86', 'x86_64', 'arm64-v8a']; export const VALID_CHANNELS: Array = ['stable', 'beta', 'dev', 'canary']; +export const PREVIEW_API_LEVELS: Array = ['Tiramisu', 'UpsideDownCake', 'VanillaIceCream']; export function checkApiLevel(apiLevel: string): void { - if (apiLevel.startsWith('UpsideDownCake') || apiLevel === 'TiramisuPrivacySandbox') return; + if (PREVIEW_API_LEVELS.some((previewLevel) => apiLevel.startsWith(previewLevel))) return; if (isNaN(Number(apiLevel)) || !Number.isInteger(Number(apiLevel))) { throw new Error(`Unexpected API level: '${apiLevel}'.`); } From 1fef06a96024f43a7f8a6f9c19e26e2cda8957e7 Mon Sep 17 00:00:00 2001 From: Josh Lesch Date: Wed, 27 Mar 2024 17:40:07 -0500 Subject: [PATCH 4/5] Install platforms for the specified api level (#384) * Install platforms for the specified api level * Fix typo --- lib/sdk-installer.js | 2 +- src/sdk-installer.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/sdk-installer.js b/lib/sdk-installer.js index e6fbf75cd..c57dea955 100644 --- a/lib/sdk-installer.js +++ b/lib/sdk-installer.js @@ -70,7 +70,7 @@ function installAndroidSdk(apiLevel, target, arch, channelId, emulatorBuild, ndk // accept all Android SDK licenses yield exec.exec(`sh -c \\"yes | sdkmanager --licenses > /dev/null"`); console.log('Installing latest build tools, platform tools, and platform.'); - yield exec.exec(`sh -c \\"sdkmanager --install 'build-tools;${BUILD_TOOLS_VERSION}' platform-tools > /dev/null"`); + yield exec.exec(`sh -c \\"sdkmanager --install 'build-tools;${BUILD_TOOLS_VERSION}' platform-tools 'platforms;android-${apiLevel}'> /dev/null"`); console.log('Installing latest emulator.'); yield exec.exec(`sh -c \\"sdkmanager --install emulator --channel=${channelId} > /dev/null"`); if (emulatorBuild) { diff --git a/src/sdk-installer.ts b/src/sdk-installer.ts index 0fd55c8bc..164fb3953 100644 --- a/src/sdk-installer.ts +++ b/src/sdk-installer.ts @@ -43,7 +43,7 @@ export async function installAndroidSdk(apiLevel: string, target: string, arch: console.log('Installing latest build tools, platform tools, and platform.'); - await exec.exec(`sh -c \\"sdkmanager --install 'build-tools;${BUILD_TOOLS_VERSION}' platform-tools > /dev/null"`); + await exec.exec(`sh -c \\"sdkmanager --install 'build-tools;${BUILD_TOOLS_VERSION}' platform-tools 'platforms;android-${apiLevel}'> /dev/null"`); console.log('Installing latest emulator.'); await exec.exec(`sh -c \\"sdkmanager --install emulator --channel=${channelId} > /dev/null"`); From ca77a1081f9e03c954f612d2394f4beed885cd29 Mon Sep 17 00:00:00 2001 From: Yang Date: Sat, 25 May 2024 00:00:37 +1000 Subject: [PATCH 5/5] Prepare for release 2.31.0. --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b049c0a53..27cd23286 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Change Log +## v2.31.0 + +* Support setting `VanillaIceCream` as `api-level`. - [#378](https://github.com/ReactiveCircus/android-emulator-runner/pull/378) +* Install `platforms` for the specified `api-level`. - [#384](https://github.com/ReactiveCircus/android-emulator-runner/pull/384) + ## v2.30.1 * Run action on Node 20. - [#371](https://github.com/ReactiveCircus/android-emulator-runner/pull/371)