Skip to content
This repository was archived by the owner on Aug 21, 2025. It is now read-only.

Cache Swift packages in CI#8

Draft
mokagio wants to merge 3 commits intoainfra-786-apple-developer-configuration-for-gravatar-iosfrom
mokagio/cache-sps
Draft

Cache Swift packages in CI#8
mokagio wants to merge 3 commits intoainfra-786-apple-developer-configuration-for-gravatar-iosfrom
mokagio/cache-sps

Conversation

@mokagio
Copy link
Contributor

@mokagio mokagio commented Jun 19, 2025

This should make the build a bit faster.

mokagio added 3 commits June 19, 2025 14:51
This is an arbitrary change, but I noticed that if I run the tests on
my machine with iPhone 16, the Simulator fails to launch:

```
Test target AnalyticsTests encountered an error (Failed to clone device named 'iPhone 16'. (Underlying Error: The operation couldn’t be completed. Device was allocated but was stuck in creation state.  Check CoreSimulator.log for more information.))
```

I tried to run the tests via Fastlane's `scan` and it automatically
picked up iPhone 16 Pro and succeeded to run the tests.

When I changed the command to use iPhone 16 Pro on my end via vanilla
`xcodebuild` like CI does, it worked.
This way, if a dev wants to run the same command as CI does locally,
they can do so.
command: |
xcodebuild test -project GravatarApp.xcodeproj -scheme GravatarApp -destination 'platform=iOS Simulator,name=iPhone 16,arch=arm64'
install_swiftpm_dependencies
make test
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The move from calling xcodebuild here to a make task is so that if a dev wants to run the same command as CI does locally, they can do so.

xed .

test: # Run the app unit tests
@xcodebuild test -project GravatarApp.xcodeproj -scheme GravatarApp -destination 'platform=iOS Simulator,name=iPhone 16 Pro'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Notice this now uses iPhone 16 Pro. This is a bit of an arbitrary change, but I noticed that if I run the tests on my machine with iPhone 16, the Simulator fails to launch:

Test target AnalyticsTests encountered an error (Failed to clone device named 'iPhone 16'. (Underlying Error: The operation couldn’t be completed. Device was allocated but was stuck in creation state.  Check CoreSimulator.log for more information.))

I tried to run the tests via Fastlane's scan and it automatically picked up iPhone 16 Pro and succeeded to run the tests.

When I changed the command to use iPhone 16 Pro on my end via vanilla xcodebuild like CI does, it worked.

@etoledom
Copy link
Contributor

etoledom commented Jul 9, 2025

@mokagio - I think this looks good. It's Ok to use iPhone 16 Pro.

Is this PR ready? Any reason that it is still a draft?
Thank you 🙏

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants