60
60
sudo docker image prune --all --force
61
61
sudo docker builder prune -a
62
62
df -h
63
+ - name : Setup
64
+ run : |
65
+ # these variabes are used by build-docker and build-local
66
+ # to determine which Swift version to build for
67
+ echo "BUILD_VERSION=${{ matrix.swift-version }}" >> $GITHUB_ENV
68
+ echo "TARGET_ARCHS=${{ matrix.arch }}" >> $GITHUB_ENV
63
69
- name : Checkout repository
64
70
uses : actions/checkout@v4
65
71
with :
@@ -69,12 +75,22 @@ jobs:
69
75
working-directory : swift-ci/sdks/android
70
76
run : |
71
77
sudo apt install -q ninja-build patchelf
72
- BUILD_VERSION=${{ matrix.swift-version }} TARGET_ARCHS=${{ matrix.arch }} ./build-local
78
+ ./build-local
73
79
- name : Build Android SDK (Docker)
74
80
if : ${{ matrix.build-type == 'docker' }}
75
81
working-directory : swift-ci/sdks/android
76
82
run : |
77
- BUILD_VERSION=${{ matrix.swift-version }} TARGET_ARCHS=${{ matrix.arch }} ./build-docker
83
+ ./build-docker
84
+ - name : Install Host Toolchain
85
+ if : ${{ matrix.build-type == 'docker' }}
86
+ working-directory : swift-ci/sdks/android
87
+ run : |
88
+ # when building in a Docker container, we don't have a host toolchain
89
+ # locally, but we need one in order to run the SDK validation tests
90
+ source ./scripts/toolchain-vars.sh
91
+ mkdir -p ${{ runner.temp }}/swift-android-sdk/host-toolchain
92
+ ./scripts/install-swift.sh ${{ runner.temp }}/swift-android-sdk/host-toolchain/swift
93
+ ${{ runner.temp }}/swift-android-sdk/host-toolchain/swift/bin/swift --version
78
94
- name : Get artifact info
79
95
id : info
80
96
shell : bash
87
103
echo "swift-root=${SWIFT_ROOT}" >> $GITHUB_OUTPUT
88
104
echo "swift-path=${SWIFT_ROOT}/usr/bin/swift" >> $GITHUB_OUTPUT
89
105
90
- #ARTIFACT_BUILD=$(realpath ${{ runner.temp }}/swift-android-sdk/build/*.artifactbundle)
91
106
ARTIFACT_PATH=$(realpath ${{ runner.temp }}/swift-android-sdk/products/*.artifactbundle.tar.gz)
92
107
echo "artifact-path=${ARTIFACT_PATH}" >> $GITHUB_OUTPUT
93
108
echo "sdk-id=x86_64-unknown-linux-android28" >> $GITHUB_OUTPUT
@@ -109,9 +124,6 @@ jobs:
109
124
# so the actual artifact download will look like:
110
125
# swift-6.1-RELEASE_android-0.1-x86_64.artifactbundle.tar.gz.zip
111
126
echo "artifact-name=${ARTIFACT_NAME}" >> $GITHUB_OUTPUT
112
-
113
- # show an abridged tree
114
- #tree ${ARTIFACT_BUILD} --filesfirst --prune -P 'Android.swiftmodule' -P 'libswiftAndroid.*' -P 'libFoundation.*' -P 'swiftrt.o' -P 'swift*.json' -P 'info.json' -P 'api-level.h' -P 'android.modulemap' -P 'SwiftAndroidNDK.h' -P 'bridging.modulemap' -P 'linux' -P 'libclang*.a' -P 'libunwind.a' -P 'libclang_rt.builtins-*-android.a'
115
127
- name : Upload SDK artifactbundle
116
128
uses : actions/upload-artifact@v4
117
129
with :
0 commit comments