Skip to content

Commit 46b7c09

Browse files
committed
Fix run-tests.sh script
1 parent 0a572c6 commit 46b7c09

File tree

1 file changed

+20
-19
lines changed

1 file changed

+20
-19
lines changed

.github/workflows/ci.yml

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,24 @@ jobs:
6969
ANDROID_CHANNEL: "3"
7070
ANDROID_NDK_VERSION: "${{ matrix.NDK_VERSION }}"
7171
steps:
72+
- name: Create run-tests script
73+
run: |
74+
echo > run-tests.sh << "EOF"
75+
#!/bin/bash -ex
76+
ORG=$(echo "${1}" | cut -f '/' -d 1)
77+
PACKAGE=$(echo "${1}" | cut -f '/' -d 2)
78+
79+
git clone https://github.com/${ORG}/${PACKAGE}
80+
cd ${PACKAGE}
81+
82+
swiftly run swift build --swift-sdk "${ANDROID_EMULATOR_ARCH_TRIPLE}-unknown-linux-android${ANDROID_API}" --build-tests
83+
84+
adb push .build/debug/${PACKAGE}PackageTests.xctest /data/local/tmp
85+
adb shell /data/local/tmp/${PACKAGE}PackageTests.xctest
86+
EOF
87+
88+
chmod +x run-tests.sh
89+
cat run-tests.sh
7290
- name: Free Disk Space
7391
if: runner.os == 'Linux'
7492
run: |
@@ -118,10 +136,10 @@ jobs:
118136
run: swiftly install --use "${SWIFT_TOOLCHAIN_VERSION}"
119137

120138
- name: Install Swift SDK for Android
121-
run: swift sdk install https://download.swift.org/development/android-sdk/${SWIFT_ANDROID_SDK_VERSION}/${SWIFT_ANDROID_SDK_VERSION}_android-0.1.artifactbundle.tar.gz --checksum ${SWIFT_ANDROID_SDK_CHECKSUM}
139+
run: swiftly run swift sdk install https://download.swift.org/development/android-sdk/${SWIFT_ANDROID_SDK_VERSION}/${SWIFT_ANDROID_SDK_VERSION}_android-0.1.artifactbundle.tar.gz --checksum ${SWIFT_ANDROID_SDK_CHECKSUM}
122140

123141
- name: List Swift SDKs
124-
run: swift sdk list
142+
run: swiftly run swift sdk list
125143

126144
- name: Install Android NDK
127145
run: |
@@ -218,23 +236,6 @@ jobs:
218236
adb push swift-sdks/${SWIFT_ANDROID_SDK_VERSION}*.artifactbundle/swift-android/swift-resources/usr/lib/swift-${ANDROID_EMULATOR_ARCH_TRIPLE}/android/*.so /data/local/tmp/
219237
cd -
220238
221-
- name: Create run-tests script
222-
run: |
223-
echo > run-tests.sh << 'EOF'
224-
#!/bin/sh -ex
225-
ORG=$(echo "${1}" | cut -f '/' -d 1)
226-
PACKAGE=$(echo "${1}" | cut -f '/' -d 2)
227-
228-
git clone https://github.com/${ORG}/${PACKAGE}
229-
cd ${PACKAGE}
230-
231-
swiftly run swift build --swift-sdk "${ANDROID_EMULATOR_ARCH_TRIPLE}-unknown-linux-android${ANDROID_API}" --build-tests
232-
233-
adb push .build/debug/${PACKAGE}PackageTests.xctest /data/local/tmp
234-
adb shell /data/local/tmp/${PACKAGE}PackageTests.xctest
235-
EOF
236-
237-
chmod +x run-tests.sh
238239
239240
- name: Run swift-algorithms tests
240241
run: ./run-tests.sh apple/swift-algorithms

0 commit comments

Comments
 (0)