Skip to content
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

Upgrade Swift version and dependencies #3321

Merged
merged 8 commits into from
Apr 26, 2024
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: 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