@@ -204,19 +204,37 @@ jobs:
204204 adb push $ANDROID_NDK_HOME/toolchains/llvm/prebuilt/*/sysroot/usr/lib/${ANDROID_EMULATOR_ARCH_TRIPLE}-linux-android/libc++_shared.so /data/local/tmp/
205205 adb shell /data/local/tmp/hello
206206
207- - name : Create run-tests script
207+ - name : Create android-ci script
208208 run : |
209- cat > run-tests .sh << "EOF"
209+ cat > android-ci .sh << "EOF"
210210 #!/bin/bash -ex
211- ORG=$(echo "${1}" | cut -d '/' -f 1)
212- PACKAGE=$(echo "${1}" | cut -d '/' -f 2)
211+
212+ if [[ -z "${2}" ]]; then
213+ echo "$0: Usage: $0 build/test org/package
214+ exit 1
215+ fi
216+
217+ ACT=${1}
218+ ORG=$(echo "${2}" | cut -d '/' -f 1)
219+ PACKAGE=$(echo "${2}" | cut -d '/' -f 2)
213220
214221 git clone https://github.com/${ORG}/${PACKAGE}
215222 cd ${PACKAGE}
216223
217224 TRIPLE="${ANDROID_EMULATOR_ARCH_TRIPLE}-unknown-linux-android${ANDROID_API}"
218225 swiftly run swift build --swift-sdk "${TRIPLE}" --build-tests +"${SWIFT_TOOLCHAIN_VERSION}"
219226
227+ if [[ "${ACT}" == "build" ]]; then
228+ # build-only, not test
229+ exit 0
230+ fi
231+
232+ if [[ "${ACT}" != "test" ]]; then
233+ # build-only, not test
234+ echo "$0: Usage: $0 build/test org/package
235+ exit 1
236+ fi
237+
220238 STAGING="android-test-${PACKAGE}"
221239 rm -rf .build/"${STAGING}"
222240 mkdir .build/"${STAGING}"
@@ -247,40 +265,36 @@ jobs:
247265 adb shell "${TEST_SHELL}"
248266 EOF
249267
250- chmod +x run-tests.sh
251- cat run-tests.sh
252-
253- - name : Run swift-collections tests
254- # too slow
255- if : false
256- run : ./run-tests.sh apple/swift-collections
268+ chmod +x android-ci.sh
269+ cat android-ci.sh
257270
258271 - name : Run swift-numerics tests
259- run : ./run-tests .sh apple/swift-numerics
272+ run : ./android-ci .sh test apple/swift-numerics
260273
261274 - name : Run swift-algorithms tests
262- run : ./run-tests .sh apple/swift-algorithms
275+ run : ./android-ci .sh test apple/swift-algorithms
263276
264277 - name : Run swift-atomics tests
265- run : ./run-tests.sh apple/swift-atomics
278+ run : ./android-ci.sh test apple/swift-atomics
279+
280+ - name : Run swift-collections tests
281+ run : ./android-ci.sh test apple/swift-collections
266282
267283 - name : Run swift-system tests
268- run : ./run-tests.sh apple/swift-system
284+ # build-only: https://github.com/apple/swift-system/pull/272
285+ run : ./android-ci.sh build apple/swift-system
269286
270287 - name : Run swift-crypto tests
271- # references Tests/ file paths by absolute filename
272- if : false
273- run : ./run-tests.sh apple/swift-crypto
288+ # build-only: tests references Tests/ file paths by absolute filename
289+ run : ./android-ci.sh build apple/swift-crypto
274290
275291 - name : Run swift-nio tests
276- if : false
277- run : ./run-tests.sh apple/swift-nio
292+ run : ./android-ci.sh build apple/swift-nio
278293
279294 - name : Run swift-argument-parser tests
280295 # needs local files:
281296 # error: MathExampleTests.testMath_AddHelp : failed - No executable at '/data/local/tmp/math'.
282- if : false
283- run : ./run-tests.sh apple/swift-argument-parser
297+ run : ./android-ci.sh build apple/swift-argument-parser
284298
285299 - name : Show Android Emulator Log
286300 if : always()
0 commit comments