forked from invertase/react-native-firebase
-
Notifications
You must be signed in to change notification settings - Fork 0
706 lines (628 loc) · 28 KB
/
Copy pathtests_e2e_ios.yml
File metadata and controls
706 lines (628 loc) · 28 KB
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
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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
name: Testing E2E iOS
on:
workflow_call:
inputs:
record_screens:
description: 'Record host screencapture and simulator video artifacts'
type: boolean
default: false
workflow_dispatch:
inputs:
iterations:
description: 'Number of iterations to run. Default 1. Max 122.'
required: true
default: 1
type: number
record_screens:
description: 'Record host screencapture and simulator video artifacts'
type: boolean
default: false
pull_request:
branches:
- '**'
paths-ignore:
- 'docs/**'
- 'website/**'
- '.spellcheck.dict.txt'
- '**/*.md'
push:
branches:
- main
- release-v*
paths-ignore:
- 'docs/**'
- 'website/**'
- '.spellcheck.dict.txt'
- '**/*.md'
permissions:
contents: read
actions: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
# We want to generate our matrix dynamically
# Initial job generates the matrix as a JSON, and following job will use deserialize and use the result
matrix_prep:
# Do not run the scheduled jobs on forks
if: (github.event_name == 'schedule' && github.repository == 'invertase/react-native-firebase') || (github.event_name != 'schedule')
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.build-matrix.outputs.result }}
steps:
- id: build-matrix
# https://github.com/actions/github-script/releases
uses: actions/github-script@d746ffe35508b1917358783b479e04febd2b8f71 # v9.0.0
with:
script: |
// by default, we will run one iteration
let iterationArray = [0]
// workflow dispatch will be a drop-down of different options
if (context.eventName === "workflow_dispatch") {
const inputs = ${{ toJSON(inputs) }}
console.log('inputs is: ' + JSON.stringify(inputs))
const iterationInput = inputs.iterations
console.log('iterations input is: ' + iterationInput)
// this will expand for example with input 5 => [0, 1, 2, 3, 4]
iterationArray = []
for (let i = 0; i < iterationInput; i++) {
iterationArray.push(i);
}
console.log('iterationArray is: ' + iterationArray)
}
// If we are running on a schedule it's our periodic passive scan for flakes
// Goal is to run enough iterations on all systems that we have confidence there are no flakes
if (context.eventName === "schedule") {
const iterationCount = 15
for (let i = 0; i < iterationCount; i++) {
iterationArray.push(i);
}
}
// we want to test debug and release - they generate different code
let buildmode = ['debug', 'release'];
// Test both SPM and CocoaPods dependency resolution modes
let depResolution = ['spm', 'cocoapods'];
return {
"iteration": iterationArray,
"buildmode": buildmode,
"dep-resolution": depResolution
}
- name: Debug Output
run: echo "${{ steps.build-matrix.outputs.result }}"
# This uses the matrix generated from the matrix-prep stage
# it will run unit tests on whatever OS combinations are desired
ios:
name: iOS (${{ matrix.buildmode }}, ${{ matrix.dep-resolution }}, ${{ matrix.iteration }})
runs-on: macos-26
needs: matrix_prep
# TODO matrix across APIs, at least 11 and 15 (lowest to highest)
timeout-minutes: 107
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
NX_NO_CLOUD: true
NX_CACHE_DIRECTORY: .nx/cache
NX_WORKSPACE_DATA_DIRECTORY: .nx/workspace-data
RNFB_RECORD_SCREENS: ${{ (github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call') && inputs.record_screens && '1' || '0' }}
CCACHE_SLOPPINESS: clang_index_store,file_stat_matches,include_file_ctime,include_file_mtime,ivfsoverlay,pch_defines,modules,system_headers,time_macros
CCACHE_FILECLONE: true
CCACHE_DEPEND: true
CCACHE_INODECACHE: true
CCACHE_LIMIT_MULTIPLE: 0.95
# macos-26 + latest-stable matches local Xcode 26.5; firebase-ios-sdk requires Xcode 26.2+
XCODE_VERSION: latest-stable
strategy:
fail-fast: false
matrix: ${{fromJson(needs.matrix_prep.outputs.matrix)}}
steps:
- name: Setup Environment for Screen Recording
# https://github.com/guidepup/setup-action/releases
uses: guidepup/setup-action@5ab89fbb6641406f6f6c91057225f3fb397c2eea # v0.20.0
continue-on-error: true
if: env.RNFB_RECORD_SCREENS == '1'
with:
record: true
- name: Upload Screen Recording Environment Setup
# https://github.com/actions/upload-artifact/releases
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
continue-on-error: true
if: always() && env.RNFB_RECORD_SCREENS == '1'
with:
name: screenrecording-setup-${{ matrix.buildmode }}-${{ matrix.iteration }}.mov
path: ./recordings/
# Set up tool versions
# https://github.com/actions/setup-node/releases
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 22
- name: Configure JDK
# https://github.com/actions/setup-java/releases
uses: actions/setup-java@ad2b38190b15e4d6bdf0c97fb4fca8412226d287 # v5.3.0
with:
distribution: 'temurin'
java-version: '21'
# https://github.com/maxim-lobanov/setup-xcode/releases
- uses: maxim-lobanov/setup-xcode@ed7a3b1fda3918c0306d1b724322adc0b8cc0a90 # v1.7.0
with:
xcode-version: ${{ env.XCODE_VERSION }}
- name: Workaround Simulator Availability issues
run: |
# If using `latest-stable` xcode-version above, this is likely not needed.
# If you use *anything* but latest-stable, you may inadvertently be using a SimRuntime that is no longer installed.
# This will install the needed SimRuntime if it is missing.
if [[ "$XCODE_VERSION" != "latest-stable" ]] && ! xcrun simctl list | grep "^iOS $XCODE_VERSION"; then
# note if you specify the build version to be exactly same as xcode version
# you may see "iOS <version> is not available for download"
#xcodebuild -downloadPlatform iOS -buildVersion "$XCODE_VERSION"
xcodebuild -downloadPlatform iOS
fi
# Apparently just listing the installed simulators fixes availability inconsistency
# Without this, runs fail *intermittently* with build target not available because simulators not available
# See https://github.com/actions/runner-images/issues/13459#issuecomment-3681674842
xcrun simctl list
# https://github.com/actions/checkout/releases
- uses: actions/checkout@9f698171ed81b15d1823a05fc7211befd50c8ae0 # v6.0.3
with:
fetch-depth: 50
# Set path variables needed for caches
- name: Set workflow variables
id: workflow-variables
run: |
echo "metro-cache=$HOME/.metro" >> $GITHUB_OUTPUT
echo "xcode-version=$(xcodebuild -version|tail -1|cut -f3 -d' ')" >> $GITHUB_OUTPUT
- name: Yarn Cache Restore
# https://github.com/actions/cache/releases
uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
id: yarn-cache
continue-on-error: true
with:
path: .yarn/cache
key: ${{ runner.os }}-ios-yarn-v1-${{ hashFiles('yarn.lock') }}
restore-keys: ${{ runner.os }}-ios-yarn-v1
- name: Detox Framework Cache Restore
# https://github.com/actions/cache/releases
uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
id: detox-cache
continue-on-error: true
with:
path: ~/Library/Detox/ios
key: ${{ runner.os }}-detox-framework-cache-${{ steps.workflow-variables.outputs.xcode-version }}
# Detox is compiled during yarn install, using Xcode, set up cache first
# https://github.com/hendrikmuhs/ccache-action/releases
- uses: hendrikmuhs/ccache-action@d62db5f07c26379fc4b4e0916f098a92573c3b03 # v1.2.23
name: Xcode Compile Cache
with:
key: ${{ runner.os }}-${{ matrix.buildmode }}-${{ matrix.dep-resolution }}-ios-v3 # makes a unique key w/related restore key internally
save: "${{ github.ref == 'refs/heads/main' }}"
create-symlink: true
max-size: 1500M
# https://github.com/actions/cache/releases
- uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
name: Nx Cache Restore
id: nx-cache
continue-on-error: true
with:
path: .nx/cache
key: ${{ runner.os }}-nx-v1-${{ hashFiles('yarn.lock', 'nx.json', 'lerna.json') }}
restore-keys: ${{ runner.os }}-nx-v1
- name: Yarn Install
# https://github.com/nick-fields/retry/releases
uses: nick-fields/retry@ad984534de44a9489a53aefd81eb77f87c70dc60 # v4.0.0
with:
timeout_minutes: 15
retry_wait_seconds: 60
max_attempts: 3
command: yarn
- name: Setup Ruby
# https://github.com/ruby/setup-ruby/releases
uses: ruby/setup-ruby@89f90524b88a01fe6e0b732220432cc6142926af # v1.313.0
with:
ruby-version: 3
- name: Update Ruby build tools
# https://github.com/nick-fields/retry/releases
uses: nick-fields/retry@ad984534de44a9489a53aefd81eb77f87c70dc60 # v4.0.0
with:
timeout_minutes: 2
retry_wait_seconds: 60
max_attempts: 3
command: gem update cocoapods xcodeproj
- name: Pods Cache Restore
# https://github.com/actions/cache/releases
uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
id: pods-cache
continue-on-error: true
with:
path: tests/ios/Pods
key: ${{ runner.os }}-${{ matrix.dep-resolution }}-ios-pods-v3-${{ hashFiles('tests/ios/Podfile.lock') }}
restore-keys: ${{ runner.os }}-${{ matrix.dep-resolution }}-ios-pods-v3
- name: Configure Dependency Resolution Mode
run: .github/workflows/scripts/configure-ios-dep-resolution.sh "${{ matrix.dep-resolution }}"
- name: Pod Install
# https://github.com/nick-fields/retry/releases
uses: nick-fields/retry@ad984534de44a9489a53aefd81eb77f87c70dc60 # v4.0.0
with:
timeout_minutes: 20
retry_wait_seconds: 30
max_attempts: 3
command: yarn tests:ios:pod:install
- name: Firestore Emulator Restore
# https://github.com/actions/cache/releases
uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
id: firestore-emulator-cache
continue-on-error: true
with:
# The firebase emulators are pure javascript and java, OS-independent
enableCrossOsArchive: true
path: ~/.cache/firebase/emulators
key: firebase-emulators-v1-${{ github.run_id }}
restore-keys: firebase-emulators-v1
- name: Start Firestore Emulator
run: yarn tests:emulator:start-ci
# https://bitrise.io/blog/post/xcode-15-performance-regressions
# https://developer.apple.com/forums/thread/805625?answerId=865340022#865340022
- name: Install yeetd and fix iOS perf issues
run: |
wget https://github.com/biscuitehh/yeetd/releases/download/1.0/yeetd-normal.pkg
sudo installer -pkg yeetd-normal.pkg -target /
yeetd &
launchctl unload -w /System/Library/LaunchAgents/com.apple.ReportCrash.plist
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.ReportCrash.Root.plist
# Vendored Homebrew formulae — pin/update: okf-bundle/ci-workflows/ios.md#pinned-homebrew-utilities
- name: Install brew utilities
# https://github.com/nick-fields/retry/releases
uses: nick-fields/retry@ad984534de44a9489a53aefd81eb77f87c70dc60 # v4.0.0
with:
timeout_minutes: 5
retry_wait_seconds: 60
max_attempts: 3
command: bash .github/workflows/scripts/install-homebrew-rnfb.sh applesimutils xcbeautify
- name: Build iOS App Debug
if: contains(matrix.buildmode, 'debug')
run: |
ccache -s
export SKIP_BUNDLING=1
export RCT_NO_LAUNCH_PACKAGER=1
set -o pipefail
echo $PATH
which clang
yarn tests:ios:build
ccache -s
shell: bash
- name: Build iOS App Release
if: contains(matrix.buildmode, 'release')
run: |
ccache -s
export RCT_NO_LAUNCH_PACKAGER=1
set -o pipefail
echo $PATH
which clang
yarn tests:ios:build:release
ccache -s
shell: bash
- name: Metro Bundler Cache Restore
if: contains(matrix.buildmode, 'debug')
# https://github.com/actions/cache/releases
uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
id: metro-bundler-cache
continue-on-error: true
with:
path: ${{ steps.workflow-variables.outputs.metro-cache }}
key: ${{ runner.os }}-ios-metro-v1-${{ github.run_id }}
restore-keys: ${{ runner.os }}-ios-metro-v1
- name: Pre-fetch Javascript bundle
if: contains(matrix.buildmode, 'debug')
run: |
nohup yarn tests:packager:jet-ci > metro.log 2>&1 &
printf 'Waiting for packager to come online'
until curl --output /dev/null --silent --head --fail http://localhost:8081/status; do
printf '.'
sleep 2
done
echo "Packager is online! Preparing bundle..."
curl --output /dev/null --silent --head --fail "http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&inlineSourceMap=true"
echo "...javascript bundle ready"
- name: Start host screen recording
if: env.RNFB_RECORD_SCREENS == '1'
continue-on-error: true
run: |
nohup sh -c "sleep 314159265 | screencapture -v -C -k -T0 -g screenrecording.mov > screenrecording.log 2>&1 &"
- name: Pre-Boot Simulator
# Separate Simulator boot from Detox run. boot-simulator.sh polls bootstatus and logs
# migration progress so long first-boot waits are visible in the step log.
# https://github.com/nick-fields/retry/releases
uses: nick-fields/retry@ad984534de44a9489a53aefd81eb77f87c70dc60 # v4.0.0
with:
timeout_minutes: 12
retry_wait_seconds: 60
max_attempts: 3
command: RNFB_START_SIM_LOGS=0 ./.github/workflows/scripts/boot-simulator.sh
- name: Start Simulator App Log
# One filtered sim log stream (testing + SpringBoard/invertase + Storage); optional sim video when record_screens.
# RNFB_SIM_LOG_STDOUT=1 surfaces sim-app.log lines in the step log for iOS Storage diagnosis (B3.1).
continue-on-error: true
run: |
chmod +x ./.github/workflows/scripts/boot-simulator.sh
RNFB_RECORD_SCREENS="${RNFB_RECORD_SCREENS}" RNFB_SIM_BOOT_MODE=logs RNFB_SIM_LOG_STDOUT=1 ./.github/workflows/scripts/boot-simulator.sh
- name: Wait for host load to settle
continue-on-error: true
run: |
chmod +x ./.github/workflows/scripts/wait-for-load-settle.sh
./.github/workflows/scripts/wait-for-load-settle.sh
- name: Detox Test Debug
if: contains(matrix.buildmode, 'debug')
timeout-minutes: 82
run: |
yarn tests:ios:test-cover 2>&1 | tee detox-step.log
exit ${PIPESTATUS[0]}
- name: Process iOS native coverage
if: always() && contains(matrix.buildmode, 'debug')
continue-on-error: true
run: yarn tests:ios:test:process-coverage
- name: Detox Test Release
if: contains(matrix.buildmode, 'release')
timeout-minutes: 82
run: |
yarn tests:ios:test:release 2>&1 | tee detox-step.log
exit ${PIPESTATUS[0]}
- name: Write flake summary
if: always()
continue-on-error: true
run: |
chmod +x ./.github/workflows/scripts/flake-summary.sh
RNFB_DETOX_LOG=detox-step.log ./.github/workflows/scripts/flake-summary.sh
- name: Stop Screen and App Video and System Logging
if: always()
continue-on-error: true
run: |
killall -int simctl
if [[ "${RNFB_RECORD_SCREENS}" == "1" ]]; then
killall -int screencapture
fi
pkill -f resource-monitor.sh || true
- name: Upload App Video
# https://github.com/actions/upload-artifact/releases
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
continue-on-error: true
if: always() && env.RNFB_RECORD_SCREENS == '1'
with:
name: simulator-${{ matrix.buildmode }}-${{ matrix.iteration }}_video
path: simulator.mp4
- name: Upload Simulator App Log
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
continue-on-error: true
if: always()
with:
name: sim-app-${{ matrix.buildmode }}-${{ matrix.iteration }}_log
path: sim-app.log
- name: Upload resource monitor log
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
continue-on-error: true
if: always()
with:
name: resource-monitor-${{ matrix.buildmode }}-${{ matrix.iteration }}_log
path: resource-monitor.log
- name: Upload flake summary
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
continue-on-error: true
if: always()
with:
name: flake-summary-${{ matrix.buildmode }}-${{ matrix.iteration }}
path: flake-summary.txt
- name: Upload Detox step log
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
continue-on-error: true
if: always()
with:
name: detox-step-${{ matrix.buildmode }}-${{ matrix.iteration }}_log
path: detox-step.log
- name: Upload Metro log
# https://github.com/actions/upload-artifact/releases
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
continue-on-error: true
if: always() && contains(matrix.buildmode, 'debug')
with:
name: metro-${{ matrix.buildmode }}-${{ matrix.iteration }}_log
path: metro.log
- name: Upload Screen Recording
# https://github.com/actions/upload-artifact/releases
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
continue-on-error: true
if: always() && env.RNFB_RECORD_SCREENS == '1'
with:
name: screenrecording-${{ matrix.buildmode }}-${{ matrix.iteration }}
path: screenrecording.*
- name: Upload Firebase emulator script logs
# https://github.com/actions/upload-artifact/releases
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
continue-on-error: true
if: always()
with:
name: emulator-scripts-logs-${{ matrix.buildmode }}-${{ matrix.iteration }}
path: .github/workflows/scripts/*.log
# https://github.com/codecov/codecov-action/releases
- name: Upload Codecov e2e TS (iOS)
uses: codecov/codecov-action@e53489f4d376d79066609109e7a95a29eb3740b1 # v7.0.0
if: contains(matrix.buildmode, 'debug')
continue-on-error: true
with:
files: coverage/lcov.info
flags: e2e-ts-ios
verbose: true
- name: Upload Codecov iOS native
uses: codecov/codecov-action@e53489f4d376d79066609109e7a95a29eb3740b1 # v7.0.0
if: contains(matrix.buildmode, 'debug')
continue-on-error: true
with:
files: coverage/ios-native/lcov.info
flags: ios-native
verbose: true
- name: Yarn Cache Save
# https://github.com/actions/cache/releases
uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
if: "${{ github.ref == 'refs/heads/main' }}"
continue-on-error: true
with:
path: .yarn/cache
key: ${{ steps.yarn-cache.outputs.cache-primary-key }}
- name: Nx Cache Save
# https://github.com/actions/cache/releases
uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
if: "${{ github.ref == 'refs/heads/main' }}"
continue-on-error: true
with:
path: .nx/cache
key: ${{ runner.os }}-nx-v1-${{ hashFiles('yarn.lock', 'nx.json', 'lerna.json') }}
- name: Detox Framework Cache Save
# https://github.com/actions/cache/releases
uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
if: "${{ github.ref == 'refs/heads/main' }}"
continue-on-error: true
with:
path: ~/Library/Detox/ios
key: ${{ steps.detox-cache.outputs.cache-primary-key }}
- name: Pods Cache Save
# https://github.com/actions/cache/releases
uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
if: "${{ github.ref == 'refs/heads/main' }}"
continue-on-error: true
with:
path: tests/ios/Pods
key: ${{ steps.pods-cache.outputs.cache-primary-key }}
- name: Firestore Emulator Cache Save
# https://github.com/actions/cache/releases
uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
if: "${{ github.ref == 'refs/heads/main' }}"
continue-on-error: true
with:
# The firebase emulators are pure javascript and java, OS-independent
enableCrossOsArchive: true
path: ~/.cache/firebase/emulators
key: ${{ steps.firestore-emulator-cache.outputs.cache-primary-key }}
- name: Metro Bundler Cache Save
# https://github.com/actions/cache/releases
uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
if: "${{ contains(matrix.buildmode, 'debug') && github.ref == 'refs/heads/main' }}"
continue-on-error: true
with:
path: ${{ steps.workflow-variables.outputs.metro-cache }}
key: ${{ steps.metro-bundler-cache.outputs.cache-primary-key }}
# Simulator/dev builds never exercise Xcode's "Archive" action, which forces
# ONLY_ACTIVE_ARCH=NO and DEPLOYMENT_POSTPROCESSING=YES (full install-style
# stripping) for a real device SDK regardless of project settings -- the
# exact difference between "works from Xcode/simulator" and "crashes only
# from a TestFlight/Fastlane archive" reported against SPM support in this
# repo. This job produces a real, unsigned device archive (no signing
# identity/provisioning profile needed) and verifies the resulting app
# bundle is actually loadable. See .github/workflows/scripts/verify-ios-release-archive.sh
# and okf-bundle/ios-spm-native-imports.md "Runtime framework embedding".
ios-release-archive:
name: iOS Release Archive (${{ matrix.dep-resolution }})
runs-on: macos-26
timeout-minutes: 45
env:
CCACHE_SLOPPINESS: clang_index_store,file_stat_matches,include_file_ctime,include_file_mtime,ivfsoverlay,pch_defines,modules,system_headers,time_macros
CCACHE_FILECLONE: true
CCACHE_DEPEND: true
CCACHE_INODECACHE: true
CCACHE_LIMIT_MULTIPLE: 0.95
XCODE_VERSION: latest-stable
strategy:
fail-fast: false
matrix:
dep-resolution: ['spm', 'cocoapods']
steps:
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 22
- uses: maxim-lobanov/setup-xcode@ed7a3b1fda3918c0306d1b724322adc0b8cc0a90 # v1.7.0
with:
xcode-version: ${{ env.XCODE_VERSION }}
- uses: actions/checkout@9f698171ed81b15d1823a05fc7211befd50c8ae0 # v6.0.3
with:
fetch-depth: 50
- name: Yarn Cache Restore
uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
id: yarn-cache
continue-on-error: true
with:
path: .yarn/cache
key: ${{ runner.os }}-ios-yarn-v1-${{ hashFiles('yarn.lock') }}
restore-keys: ${{ runner.os }}-ios-yarn-v1
- uses: hendrikmuhs/ccache-action@d62db5f07c26379fc4b4e0916f098a92573c3b03 # v1.2.23
name: Xcode Compile Cache
with:
key: ${{ runner.os }}-archive-${{ matrix.dep-resolution }}-ios-v1
save: "${{ github.ref == 'refs/heads/main' }}"
create-symlink: true
max-size: 1500M
- name: Yarn Install
uses: nick-fields/retry@ad984534de44a9489a53aefd81eb77f87c70dc60 # v4.0.0
with:
timeout_minutes: 15
retry_wait_seconds: 60
max_attempts: 3
command: yarn
- name: Setup Ruby
uses: ruby/setup-ruby@89f90524b88a01fe6e0b732220432cc6142926af # v1.313.0
with:
ruby-version: 3
- name: Update Ruby build tools
uses: nick-fields/retry@ad984534de44a9489a53aefd81eb77f87c70dc60 # v4.0.0
with:
timeout_minutes: 2
retry_wait_seconds: 60
max_attempts: 3
command: gem update cocoapods xcodeproj
- name: Pods Cache Restore
uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
id: pods-cache
continue-on-error: true
with:
path: tests/ios/Pods
key: ${{ runner.os }}-${{ matrix.dep-resolution }}-ios-pods-v3-${{ hashFiles('tests/ios/Podfile.lock') }}
restore-keys: ${{ runner.os }}-${{ matrix.dep-resolution }}-ios-pods-v3
- name: Configure Dependency Resolution Mode
run: .github/workflows/scripts/configure-ios-dep-resolution.sh "${{ matrix.dep-resolution }}"
- name: Pod Install
uses: nick-fields/retry@ad984534de44a9489a53aefd81eb77f87c70dc60 # v4.0.0
with:
timeout_minutes: 20
retry_wait_seconds: 30
max_attempts: 3
command: yarn tests:ios:pod:install
- name: Install brew utilities
uses: nick-fields/retry@ad984534de44a9489a53aefd81eb77f87c70dc60 # v4.0.0
with:
timeout_minutes: 5
retry_wait_seconds: 60
max_attempts: 3
command: bash .github/workflows/scripts/install-homebrew-rnfb.sh xcbeautify
- name: Archive Release build for a real device (unsigned) and verify embedded frameworks
working-directory: tests/ios
run: |
ccache -s
chmod +x ../../.github/workflows/scripts/verify-ios-release-archive.sh
../../.github/workflows/scripts/verify-ios-release-archive.sh
ccache -s
shell: bash
- name: Upload archive (on failure, for triage)
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
continue-on-error: true
if: failure()
with:
name: ios-release-archive-${{ matrix.dep-resolution }}
path: tests/ios/build/testing.xcarchive/Products/Applications/*/Info.plist
if-no-files-found: ignore
- name: Yarn Cache Save
uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
if: "${{ github.ref == 'refs/heads/main' }}"
continue-on-error: true
with:
path: .yarn/cache
key: ${{ steps.yarn-cache.outputs.cache-primary-key }}
- name: Pods Cache Save
uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
if: "${{ github.ref == 'refs/heads/main' }}"
continue-on-error: true
with:
path: tests/ios/Pods
key: ${{ steps.pods-cache.outputs.cache-primary-key }}