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
80 changes: 5 additions & 75 deletions .github/workflows/swift-sdk-build.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: Build Swift SDK and Example (no warnings)
name: Build and test Swift SDK (no warnings)

on:
workflow_call:

jobs:
swift-sdk-build:
name: Swift SDK and Example build (warnings as errors)
name: Swift SDK build + tests (warnings as errors)
runs-on: [self-hosted, macOS, ARM64]
timeout-minutes: 90

Expand All @@ -22,28 +22,7 @@ jobs:
-e target/ \
-e target/**

- name: Debug - Show BaseViewModel.swift content
run: |
echo "=== BaseViewModel.swift line count ==="
wc -l packages/swift-sdk/SwiftExampleApp/SwiftExampleApp/ViewModels/BaseViewModel.swift
echo "=== BaseViewModel.swift full content ==="
cat -n packages/swift-sdk/SwiftExampleApp/SwiftExampleApp/ViewModels/BaseViewModel.swift
echo "=== Git status ==="
git status
echo "=== Git log -1 ==="
git log -1 --oneline

- name: Force download correct BaseViewModel.swift from GitHub
run: |
curl -sL "https://raw.githubusercontent.com/dashpay/platform/${{ github.sha }}/packages/swift-sdk/SwiftExampleApp/SwiftExampleApp/ViewModels/BaseViewModel.swift" -o packages/swift-sdk/SwiftExampleApp/SwiftExampleApp/ViewModels/BaseViewModel.swift
echo "=== After curl - BaseViewModel.swift line count ==="
wc -l packages/swift-sdk/SwiftExampleApp/SwiftExampleApp/ViewModels/BaseViewModel.swift

- name: Show Xcode and Swift versions (use default on self-hosted runner)
run: |
xcodebuild -version
swift --version

# Rust + Cargo cache to speed up FFI build
- name: Set up Rust toolchain (stable)
uses: dtolnay/rust-toolchain@stable

Expand All @@ -61,10 +40,6 @@ jobs:
run: |
rustup target add aarch64-apple-ios aarch64-apple-ios-sim

- name: Install cbindgen (for header generation)
run: |
brew install cbindgen || true

- name: Restore cached Protobuf (protoc)
id: cache-protoc
uses: actions/cache@v5
Expand Down Expand Up @@ -111,9 +86,9 @@ jobs:
rm -rf packages/swift-sdk/.build || true
rm -rf packages/swift-sdk/SwiftExampleApp/.build || true

- name: Build DashSDKFFI.xcframework and install into Swift package
- name: Build and test Swift SDK
run: |
bash packages/swift-sdk/build_ios.sh --target all --profile release
bash packages/swift-sdk/run_tests.sh
Comment thread
ZocoLini marked this conversation as resolved.

- name: Zip XCFramework and compute checksum
run: |
Expand Down Expand Up @@ -197,48 +172,3 @@ jobs:
body
});
}

- name: Build SwiftDashSDK package (warnings as errors)
working-directory: packages/swift-sdk
env:
OTHER_SWIFT_FLAGS: -warnings-as-errors
SWIFT_TREAT_WARNINGS_AS_ERRORS: YES
SWIFT_SUPPRESS_WARNINGS: NO
run: |
xcodebuild \
-project SwiftExampleApp/SwiftExampleApp.xcodeproj \
-scheme SwiftDashSDK \
-destination 'generic/platform=iOS Simulator' \
-configuration Debug \
ARCHS=arm64 \
ONLY_ACTIVE_ARCH=YES \
OTHER_SWIFT_FLAGS="$OTHER_SWIFT_FLAGS" \
SWIFT_TREAT_WARNINGS_AS_ERRORS=$SWIFT_TREAT_WARNINGS_AS_ERRORS \
SWIFT_SUPPRESS_WARNINGS=$SWIFT_SUPPRESS_WARNINGS \
build

- name: Resolve ExampleApp dependencies
working-directory: packages/swift-sdk
run: |
xcodebuild -project SwiftExampleApp/SwiftExampleApp.xcodeproj -resolvePackageDependencies

- name: Build SwiftExampleApp (warnings as errors)
working-directory: packages/swift-sdk
env:
# Treat Swift warnings as errors during xcodebuild
OTHER_SWIFT_FLAGS: -warnings-as-errors
SWIFT_TREAT_WARNINGS_AS_ERRORS: YES
SWIFT_SUPPRESS_WARNINGS: NO
run: |
xcodebuild \
-project SwiftExampleApp/SwiftExampleApp.xcodeproj \
-scheme SwiftExampleApp \
-sdk iphonesimulator \
-destination 'generic/platform=iOS Simulator' \
-configuration Debug \
ARCHS=arm64 \
ONLY_ACTIVE_ARCH=YES \
OTHER_SWIFT_FLAGS="$OTHER_SWIFT_FLAGS" \
SWIFT_TREAT_WARNINGS_AS_ERRORS=$SWIFT_TREAT_WARNINGS_AS_ERRORS \
SWIFT_SUPPRESS_WARNINGS=$SWIFT_SUPPRESS_WARNINGS \
build
2 changes: 1 addition & 1 deletion .serena/project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ read_only: false
# This extends the existing exclusions (e.g. from the global configuration)
#
# Below is the complete list of tools for convenience.
# To make sure you have the latest list of tools, and to view their descriptions,
# To make sure you have the latest list of tools, and to view their descriptions,
# execute `uv run scripts/print_tool_overview.py`.
#
# * `activate_project`: Activates a project by name.
Expand Down
10 changes: 9 additions & 1 deletion packages/swift-sdk/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,16 @@ let package = Package(
name: "SwiftDashSDK",
dependencies: ["DashSDKFFI"],
path: "Sources/SwiftDashSDK",
exclude: ["KeyWallet/README.md"]
exclude: ["KeyWallet/README.md", "PlatformWallet/README.md"],
linkerSettings: [.linkedFramework("SystemConfiguration")]
),

// Tests
.testTarget(
name: "SwiftDashSDKTests",
dependencies: ["SwiftDashSDK"],
path: "SwiftTests/SwiftDashSDKTests"
)
Comment thread
ZocoLini marked this conversation as resolved.
],
swiftLanguageModes: [.v6]
)
Original file line number Diff line number Diff line change
Expand Up @@ -595,5 +595,5 @@ do {
## See Also

- [SwiftExampleApp Integration](../../../SwiftExampleApp/SwiftExampleApp/Services/DashPayService.swift) - Real-world usage example
- [Unit Tests](../../../SwiftTests/Tests/SwiftDashSDKTests/PlatformWalletTests.swift) - Comprehensive test examples
- [Integration Tests](../../../SwiftTests/Tests/SwiftDashSDKTests/PlatformWalletIntegrationTests.swift) - Full workflow examples
- [Unit Tests](../../../SwiftTests/SwiftDashSDKTests/PlatformWalletTests.swift) - Comprehensive test examples
- [Integration Tests](../../../SwiftTests/SwiftDashSDKTests/PlatformWalletIntegrationTests.swift) - Full workflow examples
Original file line number Diff line number Diff line change
Expand Up @@ -1485,7 +1485,7 @@ struct CreateIdentityView: View {
/// side would silently address a different outpoint and produce
/// confusing Platform-side proof-verification failures, so the
/// round-trip invariant is worth pinning explicitly.
static func parseOutPointHex(_ hex: String) -> (Data, UInt32)? {
nonisolated static func parseOutPointHex(_ hex: String) -> (Data, UInt32)? {
let parts = hex.split(
separator: ":",
maxSplits: 1,
Expand Down
31 changes: 0 additions & 31 deletions packages/swift-sdk/SwiftTests/Package.swift

This file was deleted.

Loading
Loading