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

Build for iOS simulator and tvOS simulators in CI #5

Merged
merged 2 commits into from
Aug 22, 2020
Merged
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
13 changes: 11 additions & 2 deletions .github/workflows/swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,20 @@ jobs:

steps:
- uses: actions/checkout@v1
- name: Build debug
- name: Build Swift package, debug
# Build strictly
run: swift build -v -c debug --disable-automatic-resolution
- name: Build release
- name: Build Swift package, release
# Build strictly
run: swift build -v -c release --disable-automatic-resolution
- name: Run tests
run: swift test -v

- name: Build for iOS
run: xcodebuild -scheme BachandNetworking -destination 'platform=iOS Simulator,OS=13.6,name=iPhone 11 Pro'
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't believe this at first but apparently you can build a Swift package using xcodebuild without a generated project.

@dfed we may be able to remove this step 🤔 https://github.com/dfed/CacheAdvance/blob/34524cc847e82fadd3f0d2f9c33d97c52a883e5b/Scripts/build.swift#L103

Copy link

@dfed dfed Aug 22, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is so cool!! I wonder if this functionality is new to Xcode 11. Edit: I clicked through the link and it is indeed new functionality for Xcode 11 😄

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also kind of interesting... I would like to try out Xcode Server. I guess it makes sense that you can't build a Swift package as an app without an Xcode project.

image

https://developer.apple.com/documentation/swift_packages/building_apps_that_use_swift_packages_in_continuous_integration_workflows

- name: Build for macOS
run: xcodebuild -scheme BachandNetworking -destination 'platform=macOS,variant=Mac Catalyst'
- name: Build for tvOS
run: xcodebuild -scheme BachandNetworking -destination 'platform=tvOS Simulator,OS=13.4,name=Apple TV 4K'
- name: Build for watchOS
run: echo 'Do nothing until watchOS supports XCTest'