Skip to content

Commit f4d38c1

Browse files
committed
Update emulator testing
1 parent 45bdff6 commit f4d38c1

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

.github/workflows/ci.yml

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -217,22 +217,26 @@ jobs:
217217
TRIPLE="${ANDROID_EMULATOR_ARCH_TRIPLE}-unknown-linux-android${ANDROID_API}"
218218
swiftly run swift build --swift-sdk "${TRIPLE}" --build-tests +"${SWIFT_TOOLCHAIN_VERSION}"
219219
220-
STAGING=".build/android-test-${PACKAGE}/"
221-
rm -rf "${STAGING}"
222-
mkdir "${STAGING}"
220+
cd .build
221+
STAGING="android-test-${PACKAGE}"
222+
rm -rf .build/"${STAGING}"
223+
mkdir .build/"${STAGING}"
223224
224-
cp -a .build/"${TRIPLE}"/"${PACKAGE}"PackageTests.xctest "${STAGING}"
225-
cp -a .build/"${TRIPLE}"/*.resources "${STAGING}"
226-
# for the common case of tests referencing their own resources
227-
cp -a Tests "${STAGING}"
228-
cp -a $ANDROID_NDK_HOME/toolchains/llvm/prebuilt/*/sysroot/usr/lib/${ANDROID_EMULATOR_ARCH_TRIPLE}-linux-android/libc++_shared.so "${STAGING}"
229-
cp -a "${SWIFT_ANDROID_SDK_HOME}"/swift-android/swift-resources/usr/lib/swift-${ANDROID_EMULATOR_ARCH_TRIPLE}/android/*.so /data/local/tmp/
225+
# for the common case of tests referencing their own files as hardwired resource paths
226+
cp -a Tests .build/"${STAGING}"
230227
231228
cd .build/
232-
STAGING_BASE=$(basename "${STAGING}")
233-
zip -r "${STAGING_BASE}.zip" "${STAGING_BASE}"
229+
cp -a debug/*.xctest "${STAGING}"
230+
cp -a debug/*.resources "${STAGING}" || true
231+
cp -a ${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/*/sysroot/usr/lib/${ANDROID_EMULATOR_ARCH_TRIPLE}-linux-android/libc++_shared.so "${STAGING}"
232+
cp -a ${SWIFT_ANDROID_SDK_HOME}/swift-android/swift-resources/usr/lib/swift-${ANDROID_EMULATOR_ARCH_TRIPLE}/android/*.so "${STAGING}"
233+
234+
zip -r "${STAGING}.zip" "${STAGING}"
235+
236+
adb push "${STAGING}.zip" /data/local/tmp/
237+
238+
cd -
234239
235-
adb push "${STAGING_BASE}.zip" /data/local/tmp/
236240
adb shell unzip -d /data/local/tmp/ /data/local/tmp/"${STAGING_BASE}.zip"
237241
adb shell /data/local/tmp/"${STAGING_BASE}"/"${PACKAGE}"PackageTests.xctest
238242
EOF

0 commit comments

Comments
 (0)