- 
                Notifications
    You must be signed in to change notification settings 
- Fork 44
refactor: swift sdk fixes #2772
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
e2ab7ce
              bdf2b0d
              f73203a
              1efe97d
              d75b122
              77bd5be
              b7b0ebb
              e7843ea
              5c58b00
              849911e
              9ee42d9
              15ad22f
              444800f
              82b7b6e
              492f677
              14e4972
              11b0263
              134b34b
              dbc523d
              d933a42
              0061384
              dbb52a1
              b8270a3
              a966a41
              File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,60 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: Build Swift SDK and Example (no warnings) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|  | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pull_request: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| paths: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - 'packages/swift-sdk/**' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - '.github/workflows/swift-sdk-build.yml' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| push: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| branches: [ main, master ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| paths: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - 'packages/swift-sdk/**' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - '.github/workflows/swift-sdk-build.yml' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|  | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| swift-sdk-build: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: Swift SDK and Example build (warnings as errors) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| runs-on: macos-latest | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| timeout-minutes: 60 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|  | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Checkout repository | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|  | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Select Xcode 16 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: maxim-lobanov/setup-xcode@v1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| xcode-version: '16.*' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|  | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Show Xcode and Swift versions | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| xcodebuild -version | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| swift --version | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|  | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Build SwiftDashSDK package (warnings as errors) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| working-directory: packages/swift-sdk | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| swift build -c debug -Xswiftc -warnings-as-errors | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|  | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - 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 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| xcodebuild \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -project SwiftExampleApp/SwiftExampleApp.xcodeproj \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -scheme SwiftExampleApp \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -sdk iphonesimulator \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -destination 'generic/platform=iOS Simulator' \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -configuration Debug \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ONLY_ACTIVE_ARCH=YES \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| OTHER_SWIFT_FLAGS="$OTHER_SWIFT_FLAGS" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| SWIFT_TREAT_WARNINGS_AS_ERRORS=$SWIFT_TREAT_WARNINGS_AS_ERRORS \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 
      Comment on lines
    
      +250
     to 
      +262
    
   There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Quote environment variables to prevent word splitting The             xcodebuild \
             -project SwiftExampleApp/SwiftExampleApp.xcodeproj \
             -scheme SwiftExampleApp \
             -sdk iphonesimulator \
             -destination 'generic/platform=iOS Simulator' \
             -configuration Debug \
             ONLY_ACTIVE_ARCH=YES \
-            OTHER_SWIFT_FLAGS="$OTHER_SWIFT_FLAGS" \
-            SWIFT_TREAT_WARNINGS_AS_ERRORS=$SWIFT_TREAT_WARNINGS_AS_ERRORS \
+            OTHER_SWIFT_FLAGS="${OTHER_SWIFT_FLAGS}" \
+            SWIFT_TREAT_WARNINGS_AS_ERRORS="${SWIFT_TREAT_WARNINGS_AS_ERRORS}" \
             build📝 Committable suggestion
 
        Suggested change
       
 🧰 Tools🪛 actionlint (1.7.7)50-50: shellcheck reported issue in this script: SC2086:info:9:34: Double quote to prevent globbing and word splitting (shellcheck) 🤖 Prompt for AI Agents | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| build | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Run this workflow when Rust FFI sources change.
The build_ios.sh compiles crates under packages/rs-*. Currently, PRs that only touch those paths won’t trigger this workflow.
on: pull_request: paths: - - 'packages/swift-sdk/**' + - 'packages/swift-sdk/**' + - 'packages/rs-*/**' + - 'packages/**/Cargo.toml' + - 'packages/**/Cargo.lock' - '.github/workflows/swift-sdk-build.yml' push: branches: [ main, master ] paths: - - 'packages/swift-sdk/**' + - 'packages/swift-sdk/**' + - 'packages/rs-*/**' + - 'packages/**/Cargo.toml' + - 'packages/**/Cargo.lock' - '.github/workflows/swift-sdk-build.yml'🤖 Prompt for AI Agents