Repository navigation
Conversation
The iOS CI jobs that build RNTester, HelloWorld and the template app used by the Maestro end-to-end tests still built them with CocoaPods. SwiftPM is becoming the default way to build React Native apps on iOS, so these jobs now build with SwiftPM. - HelloWorld is converted to SwiftPM and checked in. Its Podfile, workspace and Ruby files are removed. `yarn bootstrap ios` and `yarn build ios` use SwiftPM. - RNTester stays a CocoaPods project in git, so developers keep building React Native from source. CI converts it to SwiftPM before each build. The app uploaded for the Maestro tests keeps its name. - The template app is converted to SwiftPM in its build job. - A new action, setup-spm-artifacts, gives every job the prebuilt frameworks from the same CI run. - test_ios_rntester now blocks a merge. - The CocoaPods-only jobs (Ruby 3.2, dynamic frameworks, use_frameworks) and the separate SwiftPM workflows for RNTester and HelloWorld are removed. Verify locally: `yarn bootstrap ios && yarn build ios` in private/helloworld prints BUILD SUCCEEDED.
`spm add --deintegrate` keeps the Podfile since #59368, so the RNTester check now looks for CocoaPods references in RNTesterPods.xcodeproj, as the SwiftPM workflows on main do.
14f423f to
54ca50f
Compare
|
@cipolleschi This PR changes the iOS CI jobs to build our test apps with SwiftPM instead of CocoaPods. SwiftPM becomes the default in 0.89, so CI should test that setup. The PR is ready for your review. What changes:
Things that need your attention:
|
cipolleschi
left a comment
There was a problem hiding this comment.
Thanks for working on this.
I left some questions and I think we need to keep cover at least RNTester with cocoapods to ensure the opt-out mechanism does not break.
| path: /tmp/ReactCore | ||
| - name: Print ReactCore folder | ||
| if: ${{ steps.prebuilds.outputs.enabled == 'true' }} | ||
| run: pod --version || sudo gem install cocoapods --no-document |
There was a problem hiding this comment.
if we need to run this, we still need ruby. Mac machines should come with cocoapods already installed no?
This step should not be necessary.
| - name: Install CocoaPods dependencies | ||
| working-directory: packages/rn-tester | ||
| run: | | ||
| # pod deintegrate fails on non-ASCII strings without a UTF-8 locale. |
There was a problem hiding this comment.
whch non-ASCII strings we have in RNTester?? I don't think this locale thing is needed.
| fail-on-error: true | ||
| secrets: inherit | ||
|
|
||
| test_ios_spm_rntester: |
There was a problem hiding this comment.
on the other side, we might want to keep a couple of jobs to test the build with Cocoapods, to make sure we maintain it working while we have the dual setup.
SwiftPM will be the official setup, but we need to ensure that the opt-out path keeps working. For this scenario, we don't need the full matrix.
| <PreActions> | ||
| <ExecutionAction | ||
| ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction"> | ||
| <ActionContent |
There was a problem hiding this comment.
shouldn't this action be injected by our scripts? 😕
This looks scary.
| @@ -0,0 +1,43 @@ | |||
| #!/bin/bash | |||
There was a problem hiding this comment.
I see that this is generated. Why are we committing it? Generated files should be gitignored and not committed.
| @@ -0,0 +1,226 @@ | |||
| #!/bin/bash | |||
There was a problem hiding this comment.
I see that this is generated. Why are we committing it? Generated files should be gitignored and not committed.
| @@ -0,0 +1,68 @@ | |||
| // Generated by React Native on every `spm add` and `spm update`. | |||
There was a problem hiding this comment.
I see that this is generated. Why are we committing it? Generated files should be gitignored and not committed.
| # Ruby / CocoaPods | ||
| ios/Pods/ | ||
| vendor/bundle/ |
Summary:
The iOS CI jobs that build our test apps still use CocoaPods: RNTester, HelloWorld, and the template app that the Maestro end-to-end tests run. SwiftPM is becoming the default way to build React Native apps on iOS, so CI should build these apps with SwiftPM.
This PR changes those jobs to SwiftPM:
yarn bootstrap iosandyarn build iosnow use SwiftPM.spm scaffold, thenspm add --deintegrate).RNTesterApp-NewArch-{Debug,Release}, so the Maestro jobs do not change.setup-spm-artifacts, gives each job the prebuilt frameworks from the same CI run.test_ios_rntesternow blocks a merge. It replaces the blockingtest_ios_spm_rntesterjob.use_frameworksmatrix axis, andtest-ios-spm-rntester.yml/test-ios-spm-helloworld.yml(the jobs above now cover them).Things reviewers should know:
test_ios_rntester (Debug, false)becomestest_ios_rntester (Debug). If branch protection lists the old names, it must be updated.Changelog:
[INTERNAL] [CHANGED] - Build the iOS test apps with SwiftPM in CI
Test Plan:
Local, Xcode, iPhone simulator:
spm scaffold,spm add --deintegrate, thenxcodebuild -project RNTesterPods.xcodeproj -scheme RNTester. Debug and Release: BUILD SUCCEEDED. The embedded React.framework has the matching flavor (nm | grep getDebugProps: 81 symbols in Debug, 0 in Release).yarn bootstrap ios && yarn build iosinprivate/helloworld: BUILD SUCCEEDED.yarn bundle ios: passes. Before this change, all three commands failed on the converted project ("No Podfile found").yarn flow-check: 0 errors.npx eslint --max-warnings 0on the changed JavaScript files: clean.Not run locally: the template-app job and
test-ios-spm-newapp.yml. The CI run on this PR tests them.