Skip to content

Commit d512582

Browse files
committed
Android SDK build
1 parent a8ebb6c commit d512582

File tree

3 files changed

+43
-12
lines changed

3 files changed

+43
-12
lines changed

.github/workflows/pull_request.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,29 @@ jobs:
4848
- name: Build Android SDK
4949
working-directory: swift-ci/sdks/android
5050
run: |
51-
sudo apt install ninja-build
51+
sudo apt -q install ninja-build
5252
./build
5353
#TARGET_ARCHS=${{ matrix.arch }} ./build
5454
- name: Upload SDK artifactbundle
5555
uses: actions/upload-artifact@v4
5656
with:
5757
compression-level: 0
5858
path: $RUNNER_TEMP/swift-android-sdk/products/*.artifactbundle.tar.gz
59+
- name: Install SDK Locally
60+
run:
61+
$RUNNER_TEMP/host-toolchain/*/usr/bin/swift sdk install $RUNNER_TEMP/swift-android-sdk/products/*.artifactbundle.tar.gz
62+
- name: Build Demo Project
63+
run: |
64+
cd $RUNNER_TEMP
65+
mkdir DemoProject
66+
cd DemoProject
67+
$RUNNER_TEMP/host-toolchain/*/usr/bin/swift package init
68+
$RUNNER_TEMP/host-toolchain/*/usr/bin/swift build --build-tests --sdk --swift-sdk aarch64-unknown-linux-android28
69+
- name: Test Swift Package on Android
70+
# TODO: need to implement installed-sdk option in swift-android-action
71+
if: false
72+
uses: skiptools/swift-android-action@main
73+
with:
74+
package-path: $RUNNER_TEMP/DemoProject
75+
installed-sdk: aarch64-unknown-linux-android28
5976

swift-ci/sdks/android/scripts/build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
# Swift SDK for Android: Build Script
3-
set -ex
3+
set -e
44

55
# Docker sets TERM to xterm if using a pty; we probably want
66
# xterm-256color, otherwise we only get eight colors
@@ -37,7 +37,7 @@ function header {
3737
function groupstart {
3838
local text="$1"
3939
if [[ ! -z "$CI" ]]; then
40-
echo "::group::{${text}}"
40+
echo "::group::${text}"
4141
fi
4242
header $text
4343
}

swift-ci/sdks/android/scripts/fetch-source.sh

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,20 @@ function header {
3434
echo ""
3535
}
3636

37+
function groupstart {
38+
local text="$1"
39+
if [[ ! -z "$CI" ]]; then
40+
echo "::group::${text}"
41+
fi
42+
header $text
43+
}
44+
45+
function groupend {
46+
if [[ ! -z "$CI" ]]; then
47+
echo "::endgroup::"
48+
fi
49+
}
50+
3751
function usage {
3852
cat <<EOF
3953
usage: fetch-source.sh [--swift-scheme <scheme>|--swift-tag <tag>
@@ -120,9 +134,9 @@ fi
120134
cd "$source_dir"
121135

122136
# Fetch Swift
123-
header "Fetching Swift"
124-
125137
mkdir -p swift-project
138+
139+
groupstart "Fetching Swift"
126140
pushd swift-project >/dev/null
127141

128142
[[ -d swift ]] || git clone ${github}apple/swift.git
@@ -141,28 +155,28 @@ else
141155
fi
142156

143157
popd >/dev/null
158+
groupend
144159

145160
# Fetch libxml2
146-
header "Fetching libxml2"
147-
161+
groupstart "Fetching libxml2"
148162
[[ -d libxml2 ]] || git clone ${github}GNOME/libxml2.git
149163
pushd libxml2 >/dev/null 2>&1
150164
git checkout v${LIBXML2_VERSION}
151165
popd >/dev/null 2>&1
166+
groupend
152167

153168
# Fetch curl
154-
header "Fetching curl"
155-
156-
[[ -d curl ]] || git clone ${github}curl/curl.git
169+
groupstart "Fetching curl"
157170
pushd curl >/dev/null 2>&1
158171
git checkout curl-$(echo ${CURL_VERSION} | tr '.' '_')
159172
popd >/dev/null 2>&1
173+
groupend
160174

161175
# Fetch BoringSSL
162-
header "Fetching BoringSSL"
163-
176+
groupstart "Fetching BoringSSL"
164177
[[ -d boringssl ]] || git clone https://boringssl.googlesource.com/boringssl
165178
pushd boringssl >/dev/null 2>&1
166179
git checkout ${BORINGSSL_VERSION}
167180
popd >/dev/null 2>&1
181+
groupend
168182

0 commit comments

Comments
 (0)