Repository navigation
Fix Android CI: correct armv7 triple and emulator OOM #4
Workflow file for this run
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: Swift Android | |
| on: [push] | |
| jobs: | |
| android: | |
| name: Android (unit tests) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| # Cross-compiles the package for Android and runs the XCTest suite on an | |
| # Android emulator (x86_64) provisioned by the action. | |
| - name: Build and test on Android emulator | |
| uses: skiptools/swift-android-action@v2 | |
| with: | |
| swift-version: 6.3.3 | |
| # Free disk space before launching the emulator; without the headroom | |
| # the emulator has been getting OOM-killed (adb exit 137) right after boot. | |
| free-disk-space: true | |
| android-armv7: | |
| name: Android (armv7 cross-compile) | |
| runs-on: ubuntu-latest | |
| container: swift:6.3.3 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| run: apt-get update -y && apt-get install -y curl | |
| - name: Install Swift Android SDK | |
| # The Android SDK artifact bundle is only published for 6.3.3, and the | |
| # host toolchain must match the bundle version exactly (Swift's module | |
| # format isn't cross-patch-compatible) — hence the swift:6.3.3 container. | |
| run: | | |
| set -eux | |
| url="https://download.swift.org/swift-6.3.3-release/android-sdk/swift-6.3.3-RELEASE/swift-6.3.3-RELEASE_android.artifactbundle.tar.gz" | |
| curl -fsSL "$url" -o android.artifactbundle.tar.gz | |
| swift sdk install android.artifactbundle.tar.gz \ | |
| --checksum d160cc3206dd1886dae3fef2337af5e25ec034692cd0ec225721c56cc69da7f5 | |
| swift sdk list | |
| # armv7 can't run on the x86_64 emulator, so this is a cross-compile check | |
| # only. The bundle installs as a single multi-arch SDK; the architecture is | |
| # selected by target triple. The SDK's armv7 triples are named | |
| # `armv7-unknown-linux-android<api>` (not `...androideabi<api>`), one per | |
| # Android API level 28-36. | |
| - name: Build (armv7) | |
| run: swift build --swift-sdk armv7-unknown-linux-android28 |