6060 sudo docker image prune --all --force
6161 sudo docker builder prune -a
6262 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
6369 - name : Checkout repository
6470 uses : actions/checkout@v4
6571 with :
@@ -69,12 +75,22 @@ jobs:
6975 working-directory : swift-ci/sdks/android
7076 run : |
7177 sudo apt install -q ninja-build patchelf
72- BUILD_VERSION=${{ matrix.swift-version }} TARGET_ARCHS=${{ matrix.arch }} ./build-local
78+ ./build-local
7379 - name : Build Android SDK (Docker)
7480 if : ${{ matrix.build-type == 'docker' }}
7581 working-directory : swift-ci/sdks/android
7682 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
7894 - name : Get artifact info
7995 id : info
8096 shell : bash
87103 echo "swift-root=${SWIFT_ROOT}" >> $GITHUB_OUTPUT
88104 echo "swift-path=${SWIFT_ROOT}/usr/bin/swift" >> $GITHUB_OUTPUT
89105
90- #ARTIFACT_BUILD=$(realpath ${{ runner.temp }}/swift-android-sdk/build/*.artifactbundle)
91106 ARTIFACT_PATH=$(realpath ${{ runner.temp }}/swift-android-sdk/products/*.artifactbundle.tar.gz)
92107 echo "artifact-path=${ARTIFACT_PATH}" >> $GITHUB_OUTPUT
93108 echo "sdk-id=x86_64-unknown-linux-android28" >> $GITHUB_OUTPUT
@@ -109,9 +124,6 @@ jobs:
109124 # so the actual artifact download will look like:
110125 # swift-6.1-RELEASE_android-0.1-x86_64.artifactbundle.tar.gz.zip
111126 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'
115127 - name : Upload SDK artifactbundle
116128 uses : actions/upload-artifact@v4
117129 with :
0 commit comments