Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ jobs:
name: Android Swift SDK
# Workaround https://github.com/nektos/act/issues/1875
uses: apple/swift-nio/.github/workflows/android_sdk.yml@main
with:
additional_command_arguments: "--target NIOCore"

macos-tests:
name: macOS tests
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,6 @@ jobs:
name: Android Swift SDK
# Workaround https://github.com/nektos/act/issues/1875
uses: apple/swift-nio/.github/workflows/android_sdk.yml@main
with:
additional_command_arguments: "--target NIOCore"

release-builds:
name: Release builds
Expand Down
5 changes: 5 additions & 0 deletions Sources/NIOPerformanceTester/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ import NIOCore
import NIOEmbedded
import NIOFoundationCompat
import NIOHTTP1
#if os(Android)
// workaround for error: reference to var 'stdout' is not concurrency-safe because it involves shared mutable state
@preconcurrency import NIOPosix
#else
import NIOPosix
#endif
import NIOWebSocket

// Use unbuffered stdout to help detect exactly which test was running in the event of a crash.
Expand Down
18 changes: 18 additions & 0 deletions scripts/install_swift_sdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ version="${INSTALL_SWIFT_VERSION:=""}"
arch="${INSTALL_SWIFT_ARCH:="aarch64"}"
os_image="${INSTALL_SWIFT_OS_IMAGE:="ubuntu22.04"}"
sdk="${INSTALL_SWIFT_SDK:="static-sdk"}"
android_ndk_version="${INSTALL_ANDROID_NDK:="r27d"}"

if [[ ! ( -n "$branch" && -z "$version" ) && ! ( -z "$branch" && -n "$version") ]]; then
fatal "Exactly one of build or version must be defined."
Expand Down Expand Up @@ -127,3 +128,20 @@ swift --version

log "Installing Swift SDK"
swift sdk install "$sdk_path"

log "Swift SDK Post-install"
if [[ "$sdk" == "android-sdk" ]]; then
# guess some common places where the swift-sdks folder lives
cd ~/Library/org.swift.swiftpm || cd ~/.config/swiftpm || cd ~/.local/swiftpm || cd ~/.swiftpm || cd /root/.swiftpm || fatal "Cannot locate swiftpm config directory"

# download and link the NDK
android_ndk_url="https://dl.google.com/android/repository/android-ndk-${android_ndk_version}-$(uname -s).zip"
log "Android Native Development Kit URL: ${android_ndk_url}"
"$CURL_BIN" -fsSL -o ndk.zip --retry 3 "${android_ndk_url}"
unzip -q ndk.zip
rm ndk.zip
export ANDROID_NDK_HOME="${PWD}/android-ndk-${android_ndk_version}"
bundledir=$(find . -type d -maxdepth 2 -name '*android*.artifactbundle' | head -n 1)
"${bundledir}"/swift-android/scripts/setup-android-sdk.sh
cd - || fatal "Cannot cd back to previous directory"
fi