Try to run the Android emulator #17
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: universal ci | |
| on: | |
| push: | |
| branches: [ main ] | |
| workflow_dispatch: | |
| jobs: | |
| install-sdk: | |
| strategy: | |
| matrix: | |
| include: | |
| - name: 'macOS 13' | |
| os: 'macos-13' | |
| ANDROID_API: 28 | |
| ANDROID_ARCH: 'x86_64' | |
| - name: 'macOS 14' | |
| os: 'macos-14' | |
| ANDROID_API: 28 | |
| ANDROID_ARCH: 'armeabi-v7a' | |
| - name: 'macOS 15' | |
| os: 'macos-15' | |
| ANDROID_API: 28 | |
| ANDROID_ARCH: 'armeabi-v7a' | |
| fail-fast: false | |
| runs-on: ${{ matrix.os }} | |
| env: | |
| ANDROID_API: ${{ matrix.ANDROID_API }} | |
| ANDROID_ARCH: ${{ matrix.ANDROID_ARCH }} | |
| steps: | |
| - name: "Launch emulator" | |
| timeout-minutes: 5 | |
| run: | | |
| # Install AVD files | |
| echo "y" | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --install "system-images;android-${ANDROID_API};default;${ANDROID_ARCH}" | |
| # Create emulator | |
| echo "y" | $ANDROID_HOME/cmdline-tools/latest/bin/avdmanager create avd -f -n test -d "Nexus 10" -k "system-images;android-${ANDROID_API};default;${ANDROID_ARCH}" --force | |
| echo "y" | $ANDROID_HOME/emulator/emulator -list-avds | |
| echo "Starting emulator" | |
| # Start emulator in background | |
| nohup $ANDROID_HOME/emulator/emulator -avd test -no-snapshot -no-window -no-audio -no-boot-anim -accel off -no-metrics & | |
| # Fixed quoting around "\r" | |
| $ANDROID_HOME/platform-tools/adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed | tr -d "\r") ]]; do sleep 1; done; input keyevent 82' | |
| $ANDROID_HOME/platform-tools/adb devices | |
| echo "Emulator started" | |
| - name: "Install SDK" | |
| run: | | |
| HOST_TOOLCHAIN_URL="https://download.swift.org/development/xcode/swift-DEVELOPMENT-SNAPSHOT-2025-08-08-a/swift-DEVELOPMENT-SNAPSHOT-2025-08-08-a-osx.pkg" | |
| curl -fsSL --retry 8 --retry-connrefused ${HOST_TOOLCHAIN_URL} --output swift.pkg | |
| /usr/sbin/installer -pkg swift.pkg -target CurrentUserHomeDirectory | |
| SWIFT_PATH=${HOME}/Library/Developer/Toolchains/$(basename ${HOST_TOOLCHAIN_URL} "-osx.pkg").xctoolchain/usr | |
| ${SWIFT_PATH}/bin/swift --version | |
| mkdir PackageDemo | |
| cd PackageDemo | |
| ${SWIFT_PATH}/bin/swift package init | |
| ${SWIFT_PATH}/bin/swift test | |
| ${SWIFT_PATH}/bin/swift sdk install https://download.swift.org/swift-6.2-branch/static-sdk/swift-6.2-DEVELOPMENT-SNAPSHOT-2025-08-09-a/swift-6.2-DEVELOPMENT-SNAPSHOT-2025-08-09-a_static-linux-0.0.1.artifactbundle.tar.gz --checksum 157dbf0cc8465f72c00a765c5f99e24d06c06b71cbe59136421163aa2c0fa7eb | |