name: test-ios-rntester description: Test iOS RNTester inputs: ruby-version: description: The version of ruby that must be used default: 2.6.10 run-unit-tests: description: whether unit tests should run or not. default: false flavor: description: The flavor of the build. Must be one of "Debug", "Release". default: Debug run-e2e-tests: description: Whether we want to run E2E tests or not required: false default: false use-frameworks: description: Whether we have to build with Dynamic Frameworks. If this is set to true, it builds from source required: false default: false runs: using: composite steps: - name: Setup xcode uses: ./.github/actions/setup-xcode - name: Setup node.js uses: ./.github/actions/setup-node - name: Run yarn uses: ./.github/actions/yarn-install - name: Setup ruby uses: ruby/setup-ruby@v1 with: ruby-version: ${{ inputs.ruby-version }} - name: Set nightly Hermes versions shell: bash run: | node ./scripts/releases/use-hermes-nightly.js - name: Run yarn install again, with the correct hermes version uses: ./.github/actions/yarn-install - name: Prepare IOS Tests if: ${{ inputs.run-unit-tests == 'true' }} uses: ./.github/actions/prepare-ios-tests - name: Download ReactNativeDependencies if: ${{ inputs.use-frameworks == 'false' }} uses: actions/download-artifact@v7 with: name: ReactNativeDependencies${{ inputs.flavor }}.xcframework.tar.gz path: /tmp/third-party/ - name: Print third-party folder if: ${{ inputs.use-frameworks == 'false' }} shell: bash run: ls -lR /tmp/third-party - name: Download React Native Prebuilds if: ${{ inputs.use-frameworks == 'false' }} uses: actions/download-artifact@v7 with: name: ReactCore${{ inputs.flavor }}.xcframework.tar.gz path: /tmp/ReactCore - name: Print ReactCore folder if: ${{ inputs.use-frameworks == 'false' }} shell: bash run: ls -lR /tmp/ReactCore - name: Install CocoaPods dependencies shell: bash run: | if [[ ${{ inputs.use-frameworks }} == "true" ]]; then export USE_FRAMEWORKS=dynamic else # If use-frameworks is false, let's use prebuilds export RCT_USE_LOCAL_RN_DEP="/tmp/third-party/ReactNativeDependencies${{ inputs.flavor }}.xcframework.tar.gz" export RCT_TESTONLY_RNCORE_TARBALL_PATH="/tmp/ReactCore/ReactCore${{ inputs.flavor }}.xcframework.tar.gz" fi cd packages/rn-tester bundle install bundle exec pod update hermes-engine --no-repo-update - name: Build RNTester shell: bash run: | xcodebuild \ -scheme "RNTester" \ -workspace packages/rn-tester/RNTesterPods.xcworkspace \ -configuration "${{ inputs.flavor }}" \ -sdk "iphonesimulator" \ -destination "generic/platform=iOS Simulator" \ -derivedDataPath "/tmp/RNTesterBuild" echo "Print path to *.app file" APP_PATH=$(find "/tmp/RNTesterBuild" -type d -name "*.app") echo "App found at $APP_PATH" echo "app-path=$APP_PATH" >> $GITHUB_ENV - name: "Run Tests: iOS Unit and Integration Tests" if: ${{ inputs.run-unit-tests == 'true' }} shell: bash run: yarn test-ios - name: Zip Derived data folder if: ${{ inputs.run-unit-tests == 'true' }} shell: bash run: | echo "zipping tests results" cd /Users/runner/Library/Developer/Xcode tar -zcvf xcresults.tar.gz "/tmp/RNTesterTestResults" - name: Upload artifact uses: actions/upload-artifact@v6 if: ${{ inputs.run-unit-tests == 'true' }} with: name: xcresults-${{ inputs.flavor }}-${{ inputs.use-frameworks == 'true' && 'dynamic-frameworks' || 'static-libraries' }}-Ruby${{ inputs.ruby-version }} path: /Users/runner/Library/Developer/Xcode/xcresults.tar.gz - name: Upload RNTester App if: ${{ inputs.use-frameworks == 'false' && inputs.ruby-version == '2.6.10' }} # This is needed to avoid conflicts with the artifacts uses: actions/upload-artifact@v6 with: name: RNTesterApp-NewArch-${{ inputs.flavor }} path: ${{ env.app-path }} - name: Store test results if: ${{ inputs.run-unit-tests == 'true' }} uses: actions/upload-artifact@v6 with: name: test-results-${{ inputs.flavor }}-${{ inputs.use-frameworks == 'true' && 'dynamic-frameworks' || 'static-libraries' }}-Ruby${{ inputs.ruby-version }} path: ./reports/junit