feat(swiftsdk): swift sdk scaffolding #4
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Swift CI | |
on: | |
pull_request: | |
paths: | |
- 'platforms/**' | |
push: | |
paths: | |
- 'platforms/**' | |
jobs: | |
swift-sdk: | |
name: Swift Package - latest | |
runs-on: macos-15 | |
strategy: | |
matrix: | |
config: | |
- debug | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Run sccache-cache | |
uses: mozilla-actions/[email protected] | |
- run: rustup update stable && rustup default stable | |
- name: Select Xcode 16.1 | |
run: sudo xcode-select -s /Applications/Xcode_16.1.app | |
- name: Select Simulator | |
run: | | |
echo "xcrun simctl list devices: $(xcrun simctl list devices)" | |
# List simulators and find the UDID of the desired one | |
UDID=$(xcrun simctl list devices | grep -E "iOS 18.1.*iPhone 16 Pro" | grep -v "unavailable" | head -1 | awk -F '[()]' '{print $2}') | |
if [ -z "$UDID" ]; then | |
echo "Simulator not found!" >&2 | |
exit 1 | |
fi | |
echo "Simulator UDID: $UDID" | |
# Pass the UDID to the next step | |
echo "SIMULATOR_UDID=$UDID" >> $GITHUB_ENV | |
- name: Install swiftformat | |
run: brew install swiftformat | |
- name: Build bindings | |
run: sh platforms/shared/zksync-sso/crates/ffi/build-swift-framework.sh | |
- name: Build & test Swift SDK | |
run: | | |
echo "SIMULATOR_UDID=${{ env.SIMULATOR_UDID }}" | |
xcodebuild test \ | |
-skipMacroValidation \ | |
-configuration debug \ | |
-workspace .github/package.xcworkspace \ | |
-scheme yttrium \ | |
-destination "platform=iOS Simulator,id=${{ env.SIMULATOR_UDID }}" || exit 1 |