Merge pull request #10 from PureSwift/feature/code-coverage #10
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 for extra headroom. | |
| free-disk-space: true | |
| # The GitHub-hosted x86_64 emulator intermittently dies with exit 137 | |
| # right after "Emulator booted" (adb: device offline). Force a cold boot | |
| # (-no-snapshot, avoiding a crash-prone snapshot restore) with software | |
| # rendering (-gpu swiftshader_indirect) and a generous boot timeout to | |
| # make the boot deterministic. | |
| android-emulator-options: -no-snapshot -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -camera-front none | |
| android-emulator-boot-timeout: 900 | |
| android-armv7: | |
| name: Android (armv7 cross-compile) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| # armv7 can't run on the x86_64 emulator, so this is a cross-compile check | |
| # only (build-tests/run-tests off skips the emulator entirely). The action | |
| # provisions the Android NDK and points the SDK at it via ANDROID_NDK_HOME; | |
| # a bare `swift:6.3.3` container can't build for Android because the SDK's | |
| # `ndk-sysroot` (semaphore.h, libc, …) is supplied by the NDK, not the | |
| # bundle. The action's build command already targets x86_64, so append a | |
| # second `--swift-sdk` for armv7 (last one wins) to retarget the compile. | |
| - name: Cross-compile for armv7 | |
| uses: skiptools/swift-android-action@v2 | |
| with: | |
| swift-version: 6.3.3 | |
| build-tests: false | |
| run-tests: false | |
| swift-build-flags: --swift-sdk armv7-unknown-linux-android28 |