Add test cases and emulator testing in CI #105
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 | |
| on: | |
| push: | |
| branches: [master] | |
| workflow_dispatch: | |
| pull_request: | |
| jobs: | |
| android: | |
| name: Android | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # os: ['ubuntu-24.04', 'macos-15-intel'] | |
| os: ['ubuntu-24.04'] | |
| arch: ['aarch64', 'x86_64', 'armv7'] | |
| android-sdk: ['nightly-6.3'] | |
| android-api: ['28', '29', '31', '33'] | |
| android-ndk: ['r27d'] | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: skiptools/actions/setup-skip@v1 | |
| with: | |
| gradle-version: 'none' | |
| install-swift-android-sdk: true | |
| swift-android-sdk-version: ${{ matrix.android-sdk }} | |
| swift-android-ndk-version: ${{ matrix.android-ndk }} | |
| - name: "Build Swift Package for Android" | |
| run: | | |
| ANDROID_NDK_ROOT="" ANDROID_SDK_VERSION=${{ matrix.android-api }} skip android build --arch ${{ matrix.arch }} --android-api-level ${{ matrix.android-api }} | |
| - name: "Test Swift Package on Android" | |
| # can only lookup the current JavaVirtualMachine on SDK >= 31 | |
| # https://github.com/swiftlang/swift-java/issues/419 | |
| if: ${{ matrix.android-api >= 31 }} | |
| uses: reactivecircus/android-emulator-runner@v2 | |
| with: | |
| api-level: ${{ matrix.android-api }} | |
| arch: x86_64 | |
| script: skip android test --android-api-level ${{ matrix.android-api }} --apk --verbose | |