Skip to content

Commit fd22bb3

Browse files
authored
chore(ci): improve iOS build caching for test harness (#126)
## Summary - Cache Xcode build artifacts in test-harness-ios job, skipping xcodebuild when only JS files change - Update turbo inputs to only track `src/specs/*.nitro.ts` instead of all TS files ## Test plan - [ ] Verify CI passes on first run (cache miss, full build) - [ ] Verify subsequent JS-only changes skip native build (cache hit)
1 parent 5615654 commit fd22bb3

File tree

2 files changed

+21
-6
lines changed

2 files changed

+21
-6
lines changed

.github/workflows/ci.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ jobs:
9999
uses: actions/cache@v4
100100
with:
101101
path: ${{ env.TURBO_CACHE_DIR }}
102-
key: ${{ runner.os }}-turborepo-android-${{ hashFiles('yarn.lock', 'android/**', 'nitrogen/generated/android/**') }}
102+
key: ${{ runner.os }}-turborepo-android-${{ hashFiles('yarn.lock', 'android/**', 'nitrogen/generated/android/**', 'src/specs/*.nitro.ts') }}
103103
restore-keys: |
104104
${{ runner.os }}-turborepo-android-
105105
@@ -158,7 +158,7 @@ jobs:
158158
uses: actions/cache@v4
159159
with:
160160
path: ${{ env.TURBO_CACHE_DIR }}
161-
key: ${{ runner.os }}-turborepo-ios-${{ hashFiles('yarn.lock', 'ios/**', 'nitrogen/generated/ios/**', '*.podspec') }}
161+
key: ${{ runner.os }}-turborepo-ios-${{ hashFiles('yarn.lock', 'ios/**', 'nitrogen/generated/ios/**', '*.podspec', 'src/specs/*.nitro.ts') }}
162162
restore-keys: |
163163
${{ runner.os }}-turborepo-ios-
164164
@@ -241,7 +241,17 @@ jobs:
241241
bundle install
242242
bundle exec pod install --project-directory=ios
243243
244+
- name: Restore iOS build cache
245+
id: ios-build-cache
246+
uses: actions/cache/restore@v4
247+
with:
248+
path: example/ios/build
249+
key: ${{ runner.os }}-ios-build-${{ env.XCODE_VERSION }}-${{ hashFiles('yarn.lock', 'ios/**', 'nitrogen/generated/ios/**', '*.podspec', 'example/ios/Podfile.lock', 'example/ios/RiveExample/**') }}
250+
restore-keys: |
251+
${{ runner.os }}-ios-build-${{ env.XCODE_VERSION }}-
252+
244253
- name: Build iOS app
254+
if: steps.ios-build-cache.outputs.cache-hit != 'true'
245255
working-directory: example/ios
246256
run: |
247257
set -o pipefail && xcodebuild \
@@ -253,6 +263,13 @@ jobs:
253263
build \
254264
CODE_SIGNING_ALLOWED=NO
255265
266+
- name: Save iOS build cache
267+
if: steps.ios-build-cache.outputs.cache-hit != 'true'
268+
uses: actions/cache/save@v4
269+
with:
270+
path: example/ios/build
271+
key: ${{ steps.ios-build-cache.outputs.cache-primary-key }}
272+
256273
- name: Boot iOS Simulator
257274
uses: futureware-tech/simulator-action@v4
258275
with:

turbo.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
"nitrogen/generated/android/**",
1010
"android",
1111
"!android/build",
12-
"src/*.ts",
13-
"src/*.tsx",
12+
"src/specs/*.nitro.ts",
1413
"example/package.json",
1514
"example/android",
1615
"!example/android/.gradle",
@@ -27,8 +26,7 @@
2726
"nitrogen/generated/ios/**",
2827
"*.podspec",
2928
"ios",
30-
"src/*.ts",
31-
"src/*.tsx",
29+
"src/specs/*.nitro.ts",
3230
"example/package.json",
3331
"example/ios",
3432
"!example/ios/build",

0 commit comments

Comments
 (0)