Add test cases and emulator testing in CI #106
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'] | |
| 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_SDK_VERSION=${{ matrix.android-api }} skip android build --arch aarch64 --arch armv7 --arch x86_64 --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: | | |
| ANDROID_SDK_VERSION=${{ matrix.android-api }} skip android test --android-api-level ${{ matrix.android-api }} --apk --verbose | |