Skip to content
Merged
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
14 changes: 11 additions & 3 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ steps:
- group: ":swift: Swift Wrapper"
key: "swift"
steps:
- label: ":swift: :darwin: Build and Test"
- label: ":swift: :darwin: Build and Test on {{matrix}}"
command: |
echo "--- :rust: Installing Rust"
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -v -y
Expand All @@ -40,13 +40,21 @@ steps:
rustup toolchain install nightly
rustup component add rust-src --toolchain nightly-aarch64-apple-darwin

echo "--- 🧹 Clearing simulator cache"
rm -rf ~/Library/Developer/CoreSimulator/Caches

echo "--- :swift: Building + Testing"
make test-swift
make test-swift-{{matrix}}
env:
IMAGE_ID: xcode-15.2
IMAGE_ID: xcode-15.3
plugins: *common_plugins
agents:
queue: mac
matrix:
- macOS
- iOS
- tvOS
- watchOS
- label: ":swift: :linux: Build and Test"
command: |
echo "--- :swift: Building + Testing"
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ local.properties
.build
.swiftpm/xcode
xcuserdata
DerivedData

# Auto-generated Swift Files
native/swift/Sources/wordpress-api-wrapper/*.swift
Expand Down
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,17 @@ test-swift-linux-in-docker: swift-linux-library
test-swift-darwin: xcframework
swift test

test-swift-macOS: test-swift-darwin

test-swift-iOS: xcframework
scripts/xcodebuild-test.sh iOS-17-4

test-swift-tvOS: xcframework
scripts/xcodebuild-test.sh tvOS-17-4

test-swift-watchOS: xcframework
scripts/xcodebuild-test.sh watchOS-10-4

test-android: bindings _test-android

publish-android-local: bindings _publish-android-local
Expand Down
18 changes: 18 additions & 0 deletions scripts/xcodebuild-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

set -euo pipefail

# Requires a parameter whose value is the os and version part of simulator
# runtime identifier returned by `xcrun simctl list runtimes`.
platform=$1

device_id=$(xcrun simctl list --json devices available | jq -re ".devices.\"com.apple.CoreSimulator.SimRuntime.${platform}\" | last.udid")

export NSUnbufferedIO=YES

xcodebuild \
-scheme wordpress \
-derivedDataPath DerivedData \
-destination "id=${device_id}" \
test \
| xcbeautify