7
7
pull_request :
8
8
branches :
9
9
- ' *'
10
+ workflow_dispatch :
10
11
11
12
concurrency :
12
13
group : ci-${{ github.ref }}
@@ -139,3 +140,47 @@ jobs:
139
140
run : swift build -c ${{ matrix.config }}
140
141
- name : Run tests (debug only)
141
142
run : swift test
143
+
144
+ android :
145
+ name : Android (Swift 6.0.2)
146
+ runs-on : ubuntu-22.04
147
+ steps :
148
+ - name : Checkout Repository
149
+ uses : actions/checkout@v4
150
+ - name : Install Swift
151
+ uses : tayloraswift/swift-install-action@master
152
+ with :
153
+ swift-prefix : swift-6.0.2-release/ubuntu2204/swift-6.0.2-RELEASE
154
+ swift-id : swift-6.0.2-RELEASE-ubuntu22.04
155
+ - name : Check Swift
156
+ run : swift --version
157
+ - name : Install Android SDK
158
+ run :
159
+ swift sdk install https://github.com/finagolfin/swift-android-sdk/releases/download/6.0.2/swift-6.0.2-RELEASE-android-24-0.1.artifactbundle.tar.gz --checksum d75615eac3e614131133c7cc2076b0b8fb4327d89dce802c25cd53e75e1881f4
160
+ - name : Check Android SDK
161
+ run :
162
+ swift sdk configure --show-configuration swift-6.0.2-RELEASE-android-24-0.1 x86_64-unknown-linux-android24
163
+ - name : Build Tests
164
+ run :
165
+ swift build --build-tests --swift-sdk x86_64-unknown-linux-android24 -Xswiftc -Xclang-linker -Xswiftc -fuse-ld=lld
166
+ - name : Prepare Android Emulator Test Script
167
+ run : |
168
+ mkdir pack
169
+ cp .build/x86_64-unknown-linux-android24/debug/xctest-dynamic-overlayPackageTests.xctest pack
170
+
171
+ cp /home/runner/.config/swiftpm/swift-sdks/swift-6.0.2-RELEASE-android-24-0.1.artifactbundle/swift-6.0.2-release-android-24-sdk/android-27c-sysroot/usr/lib/x86_64-linux-android/24/lib*.so pack
172
+ rm pack/lib{c,dl,log,m,z}.so
173
+
174
+ set -x
175
+ cat > ~/test-toolchain.sh << EOF
176
+ adb push pack /data/local/tmp
177
+ adb shell /data/local/tmp/pack/xctest-dynamic-overlayPackageTests.xctest
178
+ EOF
179
+
180
+ chmod +x ~/test-toolchain.sh
181
+ - name : Run Tests on Android Emulator
182
+ uses : reactivecircus/android-emulator-runner@v2
183
+ with :
184
+ api-level : 29
185
+ arch : x86_64
186
+ script : ~/test-toolchain.sh
0 commit comments