|
| 1 | +name: test_ios_template |
| 2 | +description: Test iOS Template |
| 3 | +inputs: |
| 4 | + jsengine: |
| 5 | + description: Which JavaScript engine to use. Must be one of "Hermes", "JSC". |
| 6 | + default: Hermes |
| 7 | + use-frameworks: |
| 8 | + description: The dependency building and linking strategy to use. Must be one of "StaticLibraries", "DynamicFrameworks" |
| 9 | + default: StaticLibraries |
| 10 | + architecture: |
| 11 | + description: The React Native architecture to Test. RNTester has always Fabric enabled, but we want to run integration test with the old arch setup |
| 12 | + default: OldArch |
| 13 | + ruby-version: |
| 14 | + description: The version of ruby that must be used |
| 15 | + default: 2.6.10 |
| 16 | + flavor: |
| 17 | + description: The flavor of the build. Must be one of "Debug", "Release". |
| 18 | + default: Debug |
| 19 | + hermes-version: |
| 20 | + description: The version of hermes |
| 21 | + required: true |
| 22 | + react-native-version: |
| 23 | + description: The version of react-native |
| 24 | + required: true |
| 25 | +runs: |
| 26 | + using: composite |
| 27 | + steps: |
| 28 | + - name: Setup xcode |
| 29 | + uses: ./.github/actions/setup-xcode |
| 30 | + - name: Setup node.js |
| 31 | + uses: ./.github/actions/setup-node |
| 32 | + - name: Run yarn |
| 33 | + shell: bash |
| 34 | + run: yarn install --non-interactive |
| 35 | + - name: Cache setup |
| 36 | + id: cache_setup |
| 37 | + uses: ./.github/actions/cache_setup |
| 38 | + with: |
| 39 | + hermes-version: ${{ inputs.hermes-version }} |
| 40 | + react-native-version: ${{ inputs.react-native-version }} |
| 41 | + - name: Download npm package artifact |
| 42 | + |
| 43 | + with: |
| 44 | + name: react-native-package |
| 45 | + path: build |
| 46 | + - name: Setup Hermes workspace |
| 47 | + uses: ./.github/actions/setup_hermes_workspace |
| 48 | + - name: Setup ruby |
| 49 | + |
| 50 | + with: |
| 51 | + ruby-version: ${{ inputs.ruby-version }} |
| 52 | + - name: Set HERMES_ENGINE_TARBALL_PATH |
| 53 | + if: inputs.jsengine == 'Hermes' |
| 54 | + shell: bash |
| 55 | + run: | |
| 56 | + BUILD_TYPE="${{ inputs.flavor }}" |
| 57 | + TARBALL_FILENAME=$(node ./packages/react-native/scripts/hermes/get-tarball-name.js --buildType "$BUILD_TYPE") |
| 58 | + echo "export HERMES_ENGINE_TARBALL_PATH=$HERMES_WS_DIR/hermes-runtime-darwin/$TARBALL_FILENAME" >> $GITHUB_ENV |
| 59 | + - name: Create iOS template project |
| 60 | + shell: bash |
| 61 | + run: | |
| 62 | + PACKAGE=$(cat build/react-native-package-version) |
| 63 | + PATH_TO_PACKAGE="$GITHUB_WORKSPACE/build/$PACKAGE" |
| 64 | + node ./scripts/releases/update-template-package.js "{\"react-native\":\"file:$PATH_TO_PACKAGE\"}" |
| 65 | + node ./scripts/e2e/init-template-e2e.js --projectName $PROJECT_NAME --templatePath "$GITHUB_WORKSPACE/packages/react-native" --directory "/tmp/$PROJECT_NAME" --verbose |
| 66 | + - name: Yarn install in template project |
| 67 | + shell: bash |
| 68 | + run: | |
| 69 | + cd /tmp/$PROJECT_NAME/android/ |
| 70 | + yarn install --non-interactive |
| 71 | + - name: Install iOS dependencies - Configuration ${{ inputs.flavor }}; New Architecture ${{ inputs.architecture }}; JS Engine ${{ inputs.jsengine }} |
| 72 | + shell: bash |
| 73 | + run: | |
| 74 | + cd /tmp/$PROJECT_NAME/ios |
| 75 | +
|
| 76 | + if [[ ${{ inputs.architecture }} == "NewArch" ]]; then |
| 77 | + export RCT_NEW_ARCH_ENABLED=1 |
| 78 | + fi |
| 79 | +
|
| 80 | + if [[ ${{ inputs.jsengine }} == "JSC" ]]; then |
| 81 | + export USE_HERMES=0 |
| 82 | + fi |
| 83 | +
|
| 84 | + if [[ ${{ inputs.use-frameworks }} == "DynamicFrameworks" ]]; then |
| 85 | + export USE_FRAMEWORKS=dynamic |
| 86 | + fi |
| 87 | +
|
| 88 | + cd .. |
| 89 | + bundle install |
| 90 | + bundle exec pod install --project-directory=ios |
| 91 | + - name: Build template project |
| 92 | + shell: bash |
| 93 | + run: | |
| 94 | + xcodebuild build \ |
| 95 | + -configuration ${{ inputs.flavor }} \ |
| 96 | + -workspace /tmp/$PROJECT_NAME/ios/$PROJECT_NAME.xcworkspace \ |
| 97 | + -scheme $PROJECT_NAME \ |
| 98 | + -sdk iphonesimulator |
0 commit comments