Skip to content

Commit 2859f64

Browse files
committed
Fix swiftly install
1 parent 687e6bd commit 2859f64

File tree

1 file changed

+33
-26
lines changed

1 file changed

+33
-26
lines changed

.github/workflows/ci.yml

Lines changed: 33 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
jobs:
88
install-sdk:
99
strategy:
10+
fail-fast: false
1011
matrix:
1112
include:
1213
#- name: 'macOS 26'
@@ -44,8 +45,6 @@ jobs:
4445
ANDROID_API: 35
4546
EMULATOR_ARCH: 'x86_64'
4647
EMULATOR_GPU: 'swiftshader_indirect'
47-
48-
fail-fast: false
4948
runs-on: ${{ matrix.os }}
5049
env:
5150
ANDROID_API: ${{ matrix.ANDROID_API }}
@@ -60,23 +59,23 @@ jobs:
6059
ANDROID_CHANNEL: "3"
6160
BUILD_TOOLS_VERSION: "35.0.0"
6261
steps:
63-
- uses: nttld/setup-ndk@v1
64-
id: setup-ndk
65-
with:
66-
ndk-version: r27d
62+
- name: Free Disk Space
63+
if: runner.os == 'Linux'
64+
run: |
65+
sudo rm -rf /usr/share/dotnet
66+
sudo rm -rf /opt/ghc
67+
sudo rm -rf "/usr/local/share/boost"
68+
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
6769
68-
- name: "Setup Environment"
70+
- name: Install Prerequisites
6971
run: |
70-
echo "$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/emulator:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$ANDROID_HOME/build-tools/${{ env.ANDROID_BUILD_TOOLS_VERSION }}" >> $GITHUB_PATH
71-
echo "ANDROID_NDK_HOME=${{ steps.setup-ndk.outputs.ndk-path }}" >> $GITHUB_ENV
72-
# needed for Linux or else the emulator will be created in
73-
# ~/.android/avd but it will be sought in ~/.config/.android/avd
7472
if [[ "${RUNNER_OS}" == "Linux" ]]; then
75-
echo "ANDROID_AVD_HOME=${XDG_CONFIG_HOME}/.android/avd" >> $GITHUB_ENV
73+
# libcurl4-openssl-dev needed for host toolchain
74+
sudo apt-get -y install libcurl4-openssl-dev
7675
fi
7776
7877
# swiftly install instructions from https://www.swift.org/install/linux/
79-
- name: "Install Swiftly"
78+
- name: Install Swiftly
8079
run: |
8180
if [[ "${RUNNER_OS}" == "macOS" ]]; then
8281
curl -O https://download.swift.org/swiftly/darwin/swiftly.pkg && \
@@ -96,35 +95,43 @@ jobs:
9695
fi
9796
echo "${SWIFTLY_BIN_DIR}" >> "${GITHUB_PATH}"
9897
99-
- name: "Install Swift Host Toolchain"
98+
- name: Install Swift Host Toolchain
10099
run: swiftly install main-snapshot-2025-10-16
101100

102-
- name: "Install Swift SDK for Android"
101+
- name: Install Swift SDK for Android
103102
run: swift sdk install https://download.swift.org/development/android-sdk/swift-DEVELOPMENT-SNAPSHOT-2025-10-16-a/swift-DEVELOPMENT-SNAPSHOT-2025-10-16-a_android-0.1.artifactbundle.tar.gz --checksum 451844c232cf1fa02c52431084ed3dc27a42d103635c6fa71bae8d66adba2500
104103

105-
- name: "List Swift SDKs"
104+
- name: List Swift SDKs
106105
run: swift sdk list
107106

108-
- name: "Setup Swift SDK for Android"
107+
- name: Install Android NDK
108+
uses: nttld/setup-ndk@v1
109+
id: setup-ndk
110+
with:
111+
ndk-version: r27d
112+
113+
- name: Setup Android Environment
114+
run: |
115+
echo "$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/emulator:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$ANDROID_HOME/build-tools/${{ env.ANDROID_BUILD_TOOLS_VERSION }}" >> $GITHUB_PATH
116+
echo "ANDROID_NDK_HOME=${{ steps.setup-ndk.outputs.ndk-path }}" >> $GITHUB_ENV
117+
# needed for Linux or else the emulator will be created in
118+
# ~/.android/avd but it will be sought in ~/.config/.android/avd
119+
if [[ "${RUNNER_OS}" == "Linux" ]]; then
120+
echo "ANDROID_AVD_HOME=${XDG_CONFIG_HOME}/.android/avd" >> $GITHUB_ENV
121+
fi
122+
123+
- name: Setup Swift SDK for Android
109124
run: |
110125
cd ~/Library/org.swift.swiftpm || cd ${XDG_CONFIG_HOME:-$HOME}/.swiftpm
111126
./swift-sdks/swift-DEVELOPMENT-SNAPSHOT-2025-10-16-a-android-0.1.artifactbundle/swift-android/scripts/setup-android-sdk.sh
112127
113-
- name: "Build Swift Executable for Android"
128+
- name: Build Swift Executable for Android
114129
run: |
115130
mkdir hello
116131
cd hello
117132
swiftly run swift package init --type executable
118133
swiftly run swift build --swift-sdk x86_64-unknown-linux-android${ANDROID_API} --static-swift-stdlib
119134
120-
- name: Free Disk Space
121-
if: runner.os == 'Linux'
122-
run: |
123-
sudo rm -rf /usr/share/dotnet
124-
sudo rm -rf /opt/ghc
125-
sudo rm -rf "/usr/local/share/boost"
126-
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
127-
128135
- name: Enable KVM
129136
if: runner.os == 'Linux'
130137
run: |

0 commit comments

Comments
 (0)