|
29 | 29 | with: |
30 | 30 | github_token: ${{ secrets.GITHUB_TOKEN }} |
31 | 31 |
|
| 32 | + # `git clean` (checkout clean: true) wipes node_modules/Pods/build so the |
| 33 | + # native side rebuilds fresh, but Metro's Haste/transform cache lives |
| 34 | + # outside the repo (in $TMPDIR) and survives between runs. After a |
| 35 | + # reanimated/worklets bump that stale cache serves JS built by the old |
| 36 | + # Babel transform, which shows up as "mismatch between native worklet |
| 37 | + # version and JS one". Clear it so the freshly-installed worklets aren't |
| 38 | + # shadowed by stale transforms. |
| 39 | + - name: Reset React Native caches |
| 40 | + run: | |
| 41 | + watchman watch-del-all 2>/dev/null || true |
| 42 | + TMP="$(node -e 'console.log(require("os").tmpdir())')" |
| 43 | + rm -rf "$TMP"/metro-* "$TMP"/haste-map-* 2>/dev/null || true |
| 44 | + rm -rf /tmp/metro-* /tmp/haste-map-* 2>/dev/null || true |
| 45 | +
|
32 | 46 | - name: Lint files |
33 | 47 | run: yarn lint |
34 | 48 |
|
|
45 | 59 |
|
46 | 60 | - name: Start Package Manager |
47 | 61 | working-directory: apps/example |
48 | | - run: CI=true yarn start & |
| 62 | + # --reset-cache: force Metro to re-transform from the freshly-installed |
| 63 | + # node_modules instead of reusing the cache that survives `git clean`. |
| 64 | + # This is the key guard against the native/JS worklet version mismatch. |
| 65 | + run: CI=true yarn start --reset-cache & |
49 | 66 |
|
50 | 67 | - name: Build example for iOS |
51 | 68 | working-directory: apps/example/ios |
|
85 | 102 |
|
86 | 103 | - name: Install and launch app on Simulator |
87 | 104 | run: | |
| 105 | + # Remove any previous build so a stale binary never lingers on the |
| 106 | + # persistent self-hosted simulator. |
| 107 | + xcrun simctl uninstall booted com.microsoft.ReactTestApp || true |
88 | 108 | xcrun simctl install booted apps/example/ios/build/Build/Products/Debug-iphonesimulator/ReactTestApp.app |
89 | 109 | xcrun simctl launch booted com.microsoft.ReactTestApp |
90 | 110 |
|
|
0 commit comments