also looking at this
feat(maps): add key-free native Android maps and shared map controls
#363
28 files
+1857
-481
Review threads live on the whole diff, not on one commit, so none are shown here - a thread's line means something in the branch's final form, and painting it into an intermediate step would put it on code it is not about.
| @@ -657,16 +657,11 @@ jobs: | ||
| 657 | 657 | echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules |
| 658 | 658 | sudo udevadm control --reload-rules |
| 659 | 659 | sudo udevadm trigger --name-match=kvm |
| 660 | - uses: reactivecircus/android-emulator-runner@v2 | |
| 660 | - name: Run native acceptance on the SDK-owned emulator | |
| 661 | 661 | env: |
| 662 | 662 | CRAFT_NATIVE_TEST_PROJECT: ${{ steps.native-project.outputs.project }} |
| 663 | with: | |
| 664 | api-level: ${{ matrix.api-level }} | |
| 665 | arch: x86_64 | |
| 666 | profile: pixel_6 | |
| 667 | emulator-options: -no-window -no-snapshot-save -gpu swiftshader_indirect -noaudio -no-boot-anim | |
| 668 | disable-animations: false | |
| 669 | script: bash packages/android/scripts/run-native-navigation-device.sh | |
| 663 | CRAFT_ANDROID_NATIVE_API: ${{ matrix.api-level }} | |
| 664 | run: bun scripts/run-native-android-acceptance.ts | |
| 670 | 665 | - name: Require the selected Android suite to pass without skips |
| 671 | 666 | run: | |
| 672 | 667 | python3 - <<'PY' |
| @@ -688,6 +683,7 @@ jobs: | ||
| 688 | 683 | name: android-navigation-recovery-api${{ matrix.api-level }} |
| 689 | 684 | path: | |
| 690 | 685 | artifacts/android-navigation/**/app/build/outputs/androidTest-results/** |
| 686 | artifacts/android-navigation/emulator/** | |
| 691 | 687 | artifacts/android-navigation/**/app/build/reports/androidTests/** |
| 692 | 688 | artifacts/android-navigation/**/app/build/outputs/connected_android_test_additional_output/** |
| 693 | 689 | artifacts/android-navigation/launcher-*.txt |
| @@ -0,0 +1,29 @@ | ||
| 1 | import { dirname, resolve } from 'node:path' | |
| 2 | import { createAndroidEmulator } from '../packages/android/src/emulator' | |
| 3 | ||
| 4 | // The SDK owns startup and disposal; acceptance still requires a responsive | |
| 5 | // native launcher and rejects every platform ANR/crash before and after tests. | |
| 6 | const api = process.env.CRAFT_ANDROID_NATIVE_API | |
| 7 | if (!['34', '35'].includes(api ?? '')) throw new Error('Select a maintained Android native acceptance API: 34 or 35') | |
| 8 | if (!process.env.CRAFT_NATIVE_TEST_PROJECT) throw new Error('Compile the native fixture before booting Android') | |
| 9 | const sdkRoot = process.env.ANDROID_HOME ?? process.env.ANDROID_SDK_ROOT | |
| 10 | const sdkmanager = Bun.which('sdkmanager') | |
| 11 | const avdmanager = Bun.which('avdmanager') | |
| 12 | if (!sdkRoot || !sdkmanager || !avdmanager) throw new Error('Install the normal Android SDK command-line tools first') | |
| 13 | const abi = process.arch === 'arm64' ? 'arm64-v8a' : 'x86_64' | |
| 14 | const session = await createAndroidEmulator({ | |
| 15 | sdkRoot, sdkmanager, avdmanager, image: `system-images;android-${api};default;${abi}`, | |
| 16 | acceleration: 'hardware', acceptLicenses: true, | |
| 17 | artifactsDirectory: resolve('artifacts/android-navigation/emulator'), | |
| 18 | }) | |
| 19 | try { | |
| 20 | const test = Bun.spawn(['bash', 'packages/android/scripts/run-native-navigation-device.sh'], { | |
| 21 | env: { ...session.env, PATH: `${dirname(session.adb)}:${session.env.PATH ?? ''}` }, | |
| 22 | stdout: 'inherit', stderr: 'inherit', | |
| 23 | }) | |
| 24 | const code = await test.exited | |
| 25 | if (code !== 0) throw new Error(`Native Android acceptance failed with exit ${code}`) | |
| 26 | } | |
| 27 | finally { | |
| 28 | await session.dispose() | |
| 29 | } | |