Skip to content

Commit

Permalink
Upgrade Swift version and dependencies (#3321)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielnugraha authored and mohammadnaseri committed May 2, 2024
1 parent 01bafb1 commit 03fade5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,35 +18,35 @@ jobs:
run:
working-directory: src/swift/flwr
name: Test
runs-on: macos-latest
runs-on: macos-14
steps:
- uses: fwal/setup-swift@v2
with:
swift-version: 5
swift-version: 5.10
- uses: actions/checkout@v4
- name: Run tests
run: arch -x86_64 xcodebuild test -scheme flwr -destination 'platform=iOS Simulator,name=iPhone 14 Pro Max,OS=16.2'
run: arch -x86_64 xcodebuild test -scheme flwr -destination 'platform=iOS Simulator,name=iPhone 15 Pro Max,OS=17.2'

build_docs:
runs-on: macos-latest
runs-on: macos-14
name: Build docs
steps:
- uses: fwal/setup-swift@v2
with:
swift-version: 5
swift-version: 5.10
- uses: actions/checkout@v4
- name: Build docs
run: ./dev/build-swift-api-ref.sh

deploy_docs:
needs: "build_docs"
if: ${{ github.ref == 'refs/heads/main' && github.repository == 'adap/flower' && !github.event.pull_request.head.repo.fork }}
runs-on: macos-latest
runs-on: macos-14
name: Deploy docs
steps:
- uses: fwal/setup-swift@v2
with:
swift-version: 5
swift-version: 5.10
- uses: actions/checkout@v4
- name: Build and deploy docs
env:
Expand Down
2 changes: 1 addition & 1 deletion dev/build-swift-api-ref.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ find ~/Library/Developer/Xcode/DerivedData -name "flwr.doccarchive" -exec rm -Rf
# In case no XCode, please refer to: https://github.com/nodejs/node-gyp/issues/569.
# Generate API reference for the Swift SDK by running `xcodebuild docbuild` in src directory.
cd src/swift/flwr && \
arch -x86_64 xcodebuild docbuild -scheme flwr -destination 'platform=iOS Simulator,name=iPhone 14 Pro Max,OS=16.2'
arch -x86_64 xcodebuild docbuild -scheme flwr -destination 'platform=iOS Simulator,name=iPhone 15 Pro Max,OS=17.2'

# Find the generated `doccarchive` file in XCode's derived data folder and copy it to the SwiftDoc directory.
cd ../../../
Expand Down
11 changes: 6 additions & 5 deletions src/swift/flwr/Package.swift
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// swift-tools-version: 5.6
// swift-tools-version: 5.9
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "flwr",
platforms: [
.iOS(.v13),
.iOS(.v16),
],
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
Expand All @@ -19,8 +19,8 @@ let package = Package(
// .package(url: /* package url */, from: "1.0.0"),
.package(url: "https://github.com/pvieito/PythonKit.git", branch: "master"),
.package(url: "https://github.com/kewlbear/NumPy-iOS.git", branch: "main"),
.package(url: "https://github.com/grpc/grpc-swift.git", from: "1.0.0"),
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.1.0"),
.package(url: "https://github.com/grpc/grpc-swift.git", from: "1.22.0"),
.package(url: "https://github.com/apple/swift-protobuf.git", from: "1.26.0"),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
Expand All @@ -30,7 +30,8 @@ let package = Package(
dependencies: [
.product(name: "GRPC", package: "grpc-swift"),
.product(name: "NumPy-iOS", package: "NumPy-iOS"),
.product(name: "PythonKit", package: "PythonKit")],
.product(name: "PythonKit", package: "PythonKit"),
.product(name: "SwiftProtobuf", package: "swift-protobuf")],
path: "Sources/Flower"),
.testTarget(
name: "FlowerTests",
Expand Down

0 comments on commit 03fade5

Please sign in to comment.