Skip to content

Commit d9ae10a

Browse files
committed
Run unit tests on an Android emulator in CI
Nested virtualization for the emulator isn't available on the macOS runner used for the build job, so this runs on ubuntu-latest via the swift-android-action, pinned to the same SDK artifact bundle already used for building.
1 parent ef94dab commit d9ae10a

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

.github/workflows/swift.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,24 @@ jobs:
6666
bash "$HOME/Library/org.swift.swiftpm/swift-sdks/swift-${{ env.SWIFT_VERSION }}-RELEASE_android.artifactbundle/swift-android/scripts/setup-android-sdk.sh"
6767
- name: Build
6868
run: swift build --swift-sdk aarch64-unknown-linux-android28 -c ${{ matrix.config }}
69+
70+
android-test:
71+
name: Android Test
72+
runs-on: ubuntu-latest
73+
strategy:
74+
fail-fast: false
75+
matrix:
76+
config: ["debug", "release"]
77+
steps:
78+
- name: Checkout
79+
uses: actions/checkout@v4
80+
- name: Test on Android emulator
81+
uses: skiptools/swift-android-action@v2
82+
with:
83+
swift-version: "6.3.2"
84+
custom-sdk-id: swift-6.3.2-RELEASE_android
85+
custom-sdk-url: https://download.swift.org/swift-6.3.2-release/android-sdk/swift-6.3.2-RELEASE/swift-6.3.2-RELEASE_android.artifactbundle.tar.gz
86+
android-api-level: 28
87+
swift-configuration: ${{ matrix.config }}
88+
free-disk-space: true
89+
run-tests: true

0 commit comments

Comments
 (0)