11name : Testing E2E iOS
22
33on :
4+ workflow_call :
5+ inputs :
6+ record_screens :
7+ description : ' Record host screencapture and simulator video artifacts'
8+ type : boolean
9+ default : false
410 workflow_dispatch :
511 inputs :
612 iterations :
713 description : ' Number of iterations to run. Default 1. Max 122.'
814 required : true
915 default : 1
1016 type : number
17+ record_screens :
18+ description : ' Record host screencapture and simulator video artifacts'
19+ type : boolean
20+ default : false
1121 pull_request :
1222 branches :
1323 - ' **'
97107 timeout-minutes : 107
98108 env :
99109 CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
110+ RNFB_RECORD_SCREENS : ${{ (github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call') && inputs.record_screens && '1' || '0' }}
100111 CCACHE_SLOPPINESS : clang_index_store,file_stat_matches,include_file_ctime,include_file_mtime,ivfsoverlay,pch_defines,modules,system_headers,time_macros
101112 CCACHE_FILECLONE : true
102113 CCACHE_DEPEND : true
@@ -112,14 +123,15 @@ jobs:
112123 # https://github.com/guidepup/setup-action/releases
113124 uses : guidepup/setup-action@5ab89fbb6641406f6f6c91057225f3fb397c2eea # v0.20.0
114125 continue-on-error : true
126+ if : env.RNFB_RECORD_SCREENS == '1'
115127 with :
116128 record : true
117129
118130 - name : Upload Screen Recording Environment Setup
119131 # https://github.com/actions/upload-artifact/releases
120132 uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
121133 continue-on-error : true
122- if : always()
134+ if : always() && env.RNFB_RECORD_SCREENS == '1'
123135 with :
124136 name : screenrecording-setup-${{ matrix.buildmode }}-${{ matrix.iteration }}.mov
125137 path : ./recordings/
@@ -327,11 +339,11 @@ jobs:
327339 curl --output /dev/null --silent --head --fail "http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&inlineSourceMap=true"
328340 echo "...javascript bundle ready"
329341
330- - name : Start Screen and System Logging
342+ - name : Start host screen recording
343+ if : env.RNFB_RECORD_SCREENS == '1'
331344 continue-on-error : true
332345 run : |
333346 nohup sh -c "sleep 314159265 | screencapture -v -C -k -T0 -g screenrecording.mov > screenrecording.log 2>&1 &"
334- nohup sh -c "log stream --backtrace --color none --style syslog > syslog.log 2>&1 &"
335347
336348 - name : Pre-Boot Simulator
337349 # Separate Simulator boot from Detox run. boot-simulator.sh polls bootstatus and logs
@@ -344,12 +356,12 @@ jobs:
344356 max_attempts : 3
345357 command : RNFB_START_SIM_LOGS=0 ./.github/workflows/scripts/boot-simulator.sh
346358
347- - name : Start Simulator Recordings and Log
348- # Log streams are owned by boot-simulator.sh (logs-only mode after pre-boot) .
359+ - name : Start Simulator App Log
360+ # One filtered sim log stream (testing + SpringBoard/invertase); optional sim video when record_screens .
349361 continue-on-error : true
350362 run : |
351363 chmod +x ./.github/workflows/scripts/boot-simulator.sh
352- RNFB_SIM_BOOT_MODE=logs ./.github/workflows/scripts/boot-simulator.sh
364+ RNFB_RECORD_SCREENS="${RNFB_RECORD_SCREENS}" RNFB_SIM_BOOT_MODE=logs ./.github/workflows/scripts/boot-simulator.sh
353365
354366 - name : Wait for host load to settle
355367 continue-on-error : true
@@ -388,43 +400,27 @@ jobs:
388400 continue-on-error : true
389401 run : |
390402 killall -int simctl
391- killall -int screencapture
392- killall -int log
403+ if [[ "${RNFB_RECORD_SCREENS}" == "1" ]]; then
404+ killall -int screencapture
405+ fi
393406 pkill -f resource-monitor.sh || true
394407
395408 - name : Upload App Video
396409 # https://github.com/actions/upload-artifact/releases
397410 uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
398411 continue-on-error : true
399- if : always()
412+ if : always() && env.RNFB_RECORD_SCREENS == '1'
400413 with :
401414 name : simulator-${{ matrix.buildmode }}-${{ matrix.iteration }}_video
402415 path : simulator.mp4
403416
404- - name : Upload Simulator Log
405- # https://github.com/actions/upload-artifact/releases
406- uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
407- continue-on-error : true
408- if : always()
409- with :
410- name : simulator-${{ matrix.buildmode }}-${{ matrix.iteration }}_log
411- path : simulator.log
412-
413- - name : Upload testing process log
414- uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
415- continue-on-error : true
416- if : always()
417- with :
418- name : testing-${{ matrix.buildmode }}-${{ matrix.iteration }}_log
419- path : testing.log
420-
421- - name : Upload SpringBoard invertase log
417+ - name : Upload Simulator App Log
422418 uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
423419 continue-on-error : true
424420 if : always()
425421 with :
426- name : springboard -${{ matrix.buildmode }}-${{ matrix.iteration }}_log
427- path : springboard-invertase .log
422+ name : sim-app -${{ matrix.buildmode }}-${{ matrix.iteration }}_log
423+ path : sim-app .log
428424
429425 - name : Upload resource monitor log
430426 uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
@@ -463,7 +459,7 @@ jobs:
463459 # https://github.com/actions/upload-artifact/releases
464460 uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
465461 continue-on-error : true
466- if : always()
462+ if : always() && env.RNFB_RECORD_SCREENS == '1'
467463 with :
468464 name : screenrecording-${{ matrix.buildmode }}-${{ matrix.iteration }}
469465 path : screenrecording.*
0 commit comments