Repository navigation
Commit 676c516
authored
Check in CI that
## Summary
`npx react-native spm deinit` takes an app from SwiftPM back to CocoaPods. No CI job tests this today. The unit tests mock `pod` and `xcodebuild`, and no job runs `deinit`. The CocoaPods jobs build apps that were never converted. A later change could break the way back without any failing check.
This PR adds the full round trip to the SwiftPM new-app job (`test-ios-spm-newapp.yml`), in the Debug cell only. `deinit` does not depend on the flavor, and the job does not retry, so a failure shows up once, where people look for SwiftPM problems.
1. Before `spm add`, the job runs `assert-spm-deinit.sh record`. It saves the sha256 of `ios/Podfile` and `ios/.gitignore` (or `absent`), and fails at once if the Podfile is missing. The job also copies `ios/`.
2. After the SwiftPM build, the job runs `npx react-native spm deinit`.
3. The job prints `diff -r` between the copy and `ios/`. This is for information only and never fails the job. It also prints when a later step fails.
4. `assert-spm-deinit.sh check` then checks:
- the Podfile is byte-identical;
- `.gitignore` is byte-identical, or gone if it was absent before;
- the `.spm-injected.json` marker and `ios/ReactNativeSPM/` are gone;
- `project.pbxproj` has no SwiftPM package references, product dependencies, `ReactNativeSPM` paths, or SwiftPM build phases;
- no shared scheme still has the SwiftPM pre-action.
5. The job runs `pod install` the same way as the HelloWorld CocoaPods job, then builds the workspace in Debug for the simulator.
The Debug cell takes longer now, because it runs `pod install` and a second app build. The Release cell is unchanged.
The check assumes the app had no Swift packages before `spm add`. The script header says so.
## Changelog:
[INTERNAL] [ADDED] - CI check that `spm deinit` takes an app back to CocoaPods and that the app then builds
## Test Plan:
I ran the script locally on copies of `private/helloworld/ios` with a test Podfile:
- `record`: prints and writes both checksums; with no Podfile it fails with a clear error.
- `check` after a real `deinit`: passes.
- `check` with no `deinit`: fails with one error for each SwiftPM change still in place.
- Wrong arguments: prints the usage and exits 2.
- `bash -n` passes on the script, and the workflow YAML parses.
Not run locally: shellcheck (not installed), and the workflow itself. CI on this PR runs it.
Differential Revision: D130158963
Pull Request resolved: #59783spm deinit takes the template app back to CocoaPods1 parent de05579 commit 676c516
2 files changed
Lines changed: 180 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
49 | 57 | | |
50 | 58 | | |
51 | 59 | | |
| |||
100 | 108 | | |
101 | 109 | | |
102 | 110 | | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
0 commit comments