Skip to content

Commit 5d132f7

Browse files
authored
Android support (#133)
* Compile for Android * Compile for Android on CI
1 parent 743ace3 commit 5d132f7

File tree

2 files changed

+46
-2
lines changed

2 files changed

+46
-2
lines changed

.github/workflows/ci.yml

+44
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,47 @@ jobs:
7474
run: swift build -c ${{ matrix.config }}
7575
- name: Run tests (debug only)
7676
run: swift test
77+
78+
android:
79+
name: Android (Swift 6.0.2)
80+
runs-on: ubuntu-22.04
81+
steps:
82+
- name: Checkout Repository
83+
uses: actions/checkout@v4
84+
- name: Install Swift
85+
uses: tayloraswift/swift-install-action@master
86+
with:
87+
swift-prefix: swift-6.0.2-release/ubuntu2204/swift-6.0.2-RELEASE
88+
swift-id: swift-6.0.2-RELEASE-ubuntu22.04
89+
- name: Check Swift
90+
run: swift --version
91+
- name: Install Android SDK
92+
run:
93+
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
94+
- name: Check Android SDK
95+
run:
96+
swift sdk configure --show-configuration swift-6.0.2-RELEASE-android-24-0.1 x86_64-unknown-linux-android24
97+
- name: Build Tests
98+
run:
99+
swift build --build-tests --swift-sdk x86_64-unknown-linux-android24 -Xswiftc -Xclang-linker -Xswiftc -fuse-ld=lld
100+
- name: Prepare Android Emulator Test Script
101+
run: |
102+
mkdir pack
103+
cp .build/x86_64-unknown-linux-android24/debug/swift-custom-dumpPackageTests.xctest pack
104+
105+
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
106+
rm pack/lib{c,dl,log,m,z}.so
107+
108+
set -x
109+
cat > ~/test-toolchain.sh << EOF
110+
adb push pack /data/local/tmp
111+
adb shell /data/local/tmp/pack/swift-custom-dumpPackageTests.xctest
112+
EOF
113+
114+
chmod +x ~/test-toolchain.sh
115+
- name: Run Tests on Android Emulator
116+
uses: reactivecircus/android-emulator-runner@v2
117+
with:
118+
api-level: 29
119+
arch: x86_64
120+
script: ~/test-toolchain.sh

Package.resolved

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"kind" : "remoteSourceControl",
66
"location" : "https://github.com/pointfreeco/xctest-dynamic-overlay",
77
"state" : {
8-
"revision" : "357ca1e5dd31f613a1d43320870ebc219386a495",
9-
"version" : "1.2.2"
8+
"revision" : "a3f634d1a409c7979cabc0a71b3f26ffa9fc8af1",
9+
"version" : "1.4.3"
1010
}
1111
}
1212
],

0 commit comments

Comments
 (0)