Skip to content

Update CI to Xcode 15.1 & run builds for iOS, watchOS, tvOS #231

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

Merged
merged 9 commits into from
Jan 9, 2024

Conversation

rebello95
Copy link
Collaborator

@rebello95 rebello95 commented Dec 11, 2023

  • Adds new CI jobs to build the library against macOS, iOS, tvOS, and watchOS rather than only the default environment (macOS)
  • Updates @available annotations to properly accommodate these additional platforms
  • Updates CI to use Xcode 15.1

Originally the intent was to run tests on each platform, but for some reason GitHub runners are refusing to cooperate and jobs are stalling. Instead, we'll continue running swift test which runs tests on the host environment (macOS) and will use xcodebuild to build for each platform since it allows for specifying a target SDK/environment (see this question and these notes).

Follow-up to #227 and related to #226.

- Updates CI to run tests against macOS, iOS, tvOS, and watchOS rather than only the default environment (macOS)
- Switches from using `swift test` to `xcodebuild test` since the former does not allow for specifying a target SDK/environment (see [this question](https://stackoverflow.com/questions/60245159/how-can-i-build-a-swift-package-for-ios-over-command-line) and [these notes](https://www.jessesquires.com/blog/2021/11/03/swift-package-ios-tests/))
- Updates `@available` annotations to properly accomodate these additional platforms

Follow-up to #227 and related to #226.
Copy link
Contributor

@eseay eseay left a comment

Choose a reason for hiding this comment

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

Just one suggestion/idea.

Makefile Outdated
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure if I am doing this unnecessarily, but one thing I always add when running this in my own CI jobs is set -o pipefail so that encountered errors will properly fail the job.

Also, I brew install xcbeautify and pipe the output of the xcodebuild command to xcbeautify to make the log output way more manageable.

So my invocations would look something like this (note that I normally put the test earlier in the command - no logical difference):

set -o pipefail && xcodebuild test -scheme Connect-Package -destination 'platform=iOS Simulator,name=iPhone 15,OS=17.0.1' | xcbeautify

@eseay
Copy link
Contributor

eseay commented Dec 12, 2023

Not sure why the CI is failing, but I do know that we've had issues since moving to Xcode 15 in Actions on my own projects. I see that Xcode 15.1 has just been released, and there's a pending issue to get the actions runners updated with it. 🤞

@rebello95
Copy link
Collaborator Author

Yeah I'm not really sure why these are failing either - the job seems to just hang during compilation despite it passing in a reasonable time locally. Can you link the issue you're referring to?

@rebello95
Copy link
Collaborator Author

Seems imminent: actions/runner-images#8997

@rebello95 rebello95 changed the title Update watchOS/tvOS annotations & test on CI Update CI to Xcode 15.1 & run builds for iOS, watchOS, tvOS Dec 22, 2023
@rebello95
Copy link
Collaborator Author

Looks like 15.1 didn't fix the issue on the GitHub runners. I updated the PR and its description to instead build for each platform (which does work on GitHub runners) and run tests the same way we do today on macOS. Tests are green now

@rebello95 rebello95 requested a review from eseay December 22, 2023 20:25
@rebello95 rebello95 mentioned this pull request Jan 3, 2024
@rebello95 rebello95 merged commit 2c9e0b9 into main Jan 9, 2024
@rebello95 rebello95 deleted the watchos-ci branch January 9, 2024 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants