diff --git a/.circleci/configurations/executors.yml b/.circleci/configurations/executors.yml index 3884b21abfdfc1..a7b5bdc7109f0d 100644 --- a/.circleci/configurations/executors.yml +++ b/.circleci/configurations/executors.yml @@ -36,3 +36,10 @@ executors: resource_class: macos.x86.medium.gen2 environment: - RCT_BUILD_HERMES_FROM_SOURCE: true + reactnative-visionos: + <<: *defaults + resource_class: macos.m1.medium.gen1 + macos: + xcode: '15.2' + environment: + - BUILD_FROM_SOURCE: true diff --git a/.circleci/configurations/jobs.yml b/.circleci/configurations/jobs.yml index a460bcfbc67fb5..9a42ae57c3be8d 100644 --- a/.circleci/configurations/jobs.yml +++ b/.circleci/configurations/jobs.yml @@ -589,6 +589,74 @@ jobs: steps: - run_ios_tests + # ------------------------- + # JOBS: Test visionOS RNTester + # ------------------------- + test_visionos_rntester: + + parameters: + jsengine: + default: "JSC" + description: Which JavaScript engine to use. Must be one of "Hermes", "JSC". + type: enum + enum: ["Hermes", "JSC"] + architecture: + default: "OldArch" + description: Which React Native architecture to use. Must be one of "OldArch", "NewArch". + type: enum + enum: ["NewArch", "OldArch"] + use_frameworks: + default: "StaticLibraries" + description: The dependency building and linking strategy to use. Must be one of "StaticLibraries", "DynamicFrameworks" + type: enum + enum: ["StaticLibraries", "DynamicFrameworks"] + ruby_version: + default: "2.6.10" + description: The version of ruby that must be used + type: string + run_unit_tests: + description: whether unit tests should run or not. + default: false + type: boolean + executor: + description: The executor to use + default: reactnative-visionos + type: string + executor: << parameters.executor >> + steps: + - checkout_code_with_cache + - run_yarn + - setup_ruby: + ruby_version: << parameters.ruby_version >> + - with_xcodebuild_cache: + steps: + - run: + name: "Install pods" + command: | + if [[ << parameters.architecture >> == "NewArch" ]]; then + export RCT_NEW_ARCH_ENABLED=1 + fi + + if [[ << parameters.jsengine >> == "JSC" ]]; then + export USE_HERMES=0 + fi + + if [[ << parameters.use_frameworks >> == "DynamicFrameworks" ]]; then + export USE_FRAMEWORKS=dynamic + fi + + cd packages/rn-tester + + bundle install + bundle exec pod install + - run: + name: "Build rn-tester" + command: | + xcodebuild build \ + -workspace packages/rn-tester/RNTesterPods.xcworkspace \ + -scheme RNTester-visionOS \ + -sdk xrsimulator + # ------------------------- # JOBS: Windows # ------------------------- diff --git a/.circleci/configurations/test_workflows/testVisionOS.yml b/.circleci/configurations/test_workflows/testVisionOS.yml new file mode 100644 index 00000000000000..37f3fd3f6a9c9d --- /dev/null +++ b/.circleci/configurations/test_workflows/testVisionOS.yml @@ -0,0 +1,6 @@ + test_visionos: + jobs: + - test_visionos_rntester: + matrix: + parameters: + architecture: ["OldArch", "NewArch"] diff --git a/.circleci/configurations/top_level.yml b/.circleci/configurations/top_level.yml index 6eed67c24e92dc..effda02910a133 100644 --- a/.circleci/configurations/top_level.yml +++ b/.circleci/configurations/top_level.yml @@ -59,7 +59,7 @@ references: # Dependency Anchors # ------------------------- dependency_versions: - xcode_version: &xcode_version "14.3.0" + xcode_version: &xcode_version "15.2" nodelts_image: &nodelts_image "cimg/node:20.2.0" nodeprevlts_image: &nodeprevlts_image "cimg/node:18.12.1" nodelts_browser_image: &nodelts_browser_image "cimg/node:20.2.0-browsers" @@ -74,25 +74,25 @@ references: gems_cache_key: &gems_cache_key v1-gems-{{ checksum "Gemfile.lock" }} gradle_cache_key: &gradle_cache_key v3-gradle-{{ .Environment.CIRCLE_JOB }}-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}-{{ checksum "packages/react-native/ReactAndroid/gradle.properties" }} yarn_cache_key: &yarn_cache_key v6-yarn-cache-{{ .Environment.CIRCLE_JOB }} - rbenv_cache_key: &rbenv_cache_key v1-rbenv-{{ checksum "/tmp/required_ruby" }} - hermes_workspace_cache_key: &hermes_workspace_cache_key v5-hermes-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/hermes/hermesversion" }} - hermes_workspace_debug_cache_key: &hermes_workspace_debug_cache_key v2-hermes-{{ .Environment.CIRCLE_JOB }}-debug-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}-{{ checksum "packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh" }} - hermes_workspace_release_cache_key: &hermes_workspace_release_cache_key v2-hermes-{{ .Environment.CIRCLE_JOB }}-release-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}-{{ checksum "packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh" }} - hermes_linux_cache_key: &hermes_linux_cache_key v1-hermes-{{ .Environment.CIRCLE_JOB }}-linux-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }} - hermes_windows_cache_key: &hermes_windows_cache_key v2-hermes-{{ .Environment.CIRCLE_JOB }}-windows-{{ checksum "/Users/circleci/project/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }} + rbenv_cache_key: &rbenv_cache_key v2-rbenv-{{ checksum "/tmp/required_ruby" }} + hermes_workspace_cache_key: &hermes_workspace_cache_key v7-visionos-hermes-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/hermes/hermesversion" }} + hermes_workspace_debug_cache_key: &hermes_workspace_debug_cache_key v2-visionos-hermes-{{ .Environment.CIRCLE_JOB }}-debug-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}-{{ checksum "packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh" }} + hermes_workspace_release_cache_key: &hermes_workspace_release_cache_key v2-visionos-hermes-{{ .Environment.CIRCLE_JOB }}-release-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}-{{ checksum "packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh" }} + hermes_linux_cache_key: &hermes_linux_cache_key v1-visionos-hermes-{{ .Environment.CIRCLE_JOB }}-linux-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }} + hermes_windows_cache_key: &hermes_windows_cache_key v2-visionos-hermes-{{ .Environment.CIRCLE_JOB }}-windows-{{ checksum "/Users/circleci/project/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }} # Hermes iOS - hermesc_apple_cache_key: &hermesc_apple_cache_key v2-hermesc-apple-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }} - hermes_apple_slices_cache_key: &hermes_apple_slices_cache_key v2-hermes-apple-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}-{{ checksum "packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh" }} - hermes_tarball_debug_cache_key: &hermes_tarball_debug_cache_key v4-hermes-tarball-debug-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}-{{ checksum "packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh" }} - hermes_tarball_release_cache_key: &hermes_tarball_release_cache_key v3-hermes-tarball-release-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}-{{ checksum "packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh" }} - hermes_macosx_bin_release_cache_key: &hermes_macosx_bin_release_cache_key v1-hermes-release-macosx-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }} - hermes_macosx_bin_debug_cache_key: &hermes_macosx_bin_debug_cache_key v1-hermes-debug-macosx-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }} - hermes_dsym_debug_cache_key: &hermes_dsym_debug_cache_key v1-hermes-debug-dsym-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }} - hermes_dsym_release_cache_key: &hermes_dsym_release_cache_key v1-hermes-release-dsym-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }} + hermesc_apple_cache_key: &hermesc_apple_cache_key v4-visionos-hermesc-apple-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }} + hermes_apple_slices_cache_key: &hermes_apple_slices_cache_key v4-visionos-hermes-apple-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}-{{ checksum "packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh" }} + hermes_tarball_debug_cache_key: &hermes_tarball_debug_cache_key v7-visionos-hermes-tarball-debug-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}-{{ checksum "packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh" }} + hermes_tarball_release_cache_key: &hermes_tarball_release_cache_key v4-visionos-hermes-tarball-release-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}-{{ checksum "packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh" }} + hermes_macosx_bin_release_cache_key: &hermes_macosx_bin_release_cache_key v2-visionos-hermes-release-macosx-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }} + hermes_macosx_bin_debug_cache_key: &hermes_macosx_bin_debug_cache_key v2-visionos-hermes-debug-macosx-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }} + hermes_dsym_debug_cache_key: &hermes_dsym_debug_cache_key v2-visionos-hermes-debug-dsym-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }} + hermes_dsym_release_cache_key: &hermes_dsym_release_cache_key v2-visionos-hermes-release-dsym-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }} # Cocoapods - RNTester - pods_cache_key: &pods_cache_key v10-pods-{{ .Environment.CIRCLE_JOB }}-{{ checksum "packages/rn-tester/Podfile.lock.bak" }}-{{ checksum "packages/rn-tester/Podfile" }} - cocoapods_cache_key: &cocoapods_cache_key v9-cocoapods-{{ .Environment.CIRCLE_JOB }}-{{ checksum "packages/rn-tester/Podfile.lock" }}-{{ checksum "packages/rn-tester/Podfile" }}-{{ checksum "/tmp/hermes/hermesversion" }} - rntester_podfile_lock_cache_key: &rntester_podfile_lock_cache_key v7-podfilelock-{{ .Environment.CIRCLE_JOB }}-{{ checksum "packages/rn-tester/Podfile" }}-{{ checksum "/tmp/week_year" }}-{{ checksum "/tmp/hermes/hermesversion" }} + pods_cache_key: &pods_cache_key v11-visionos-pods-{{ .Environment.CIRCLE_JOB }}-{{ checksum "packages/rn-tester/Podfile.lock.bak" }}-{{ checksum "packages/rn-tester/Podfile" }} + cocoapods_cache_key: &cocoapods_cache_key v11-visionos-cocoapods-{{ .Environment.CIRCLE_JOB }}-{{ checksum "packages/rn-tester/Podfile.lock" }}-{{ checksum "packages/rn-tester/Podfile" }} + rntester_podfile_lock_cache_key: &rntester_podfile_lock_cache_key v9-visionos-podfilelock-{{ .Environment.CIRCLE_JOB }}-{{ checksum "packages/rn-tester/Podfile" }}-{{ checksum "/tmp/week_year" }} # Cocoapods - Template template_cocoapods_cache_key: &template_cocoapods_cache_key v4-cocoapods-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/iOSTemplateProject/ios/Podfile.lock" }}-{{ checksum "/tmp/iOSTemplateProject/ios/Podfile" }}-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "packages/rn-tester/Podfile.lock }} diff --git a/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj b/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj index fed2d904e22822..b6225d972f54e4 100644 --- a/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj +++ b/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj @@ -1054,7 +1054,6 @@ CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; CLANG_ENABLE_OBJC_WEAK = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_ASSET_PATHS = "\"RNTester-visionOS/Preview Content\""; @@ -1153,7 +1152,6 @@ CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; CLANG_ENABLE_OBJC_WEAK = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; CURRENT_PROJECT_VERSION = 1; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; diff --git a/scripts/circleci/pipeline_selection.js b/scripts/circleci/pipeline_selection.js index e1cfa4b7b1d31e..994f7efa0ad335 100644 --- a/scripts/circleci/pipeline_selection.js +++ b/scripts/circleci/pipeline_selection.js @@ -144,6 +144,25 @@ async function _computeAndSavePipelineParameters(pipelineType, outputPath) { return; } + // Custom config for visionOS + if (pipelineType === 'VISION_OS') { + const params = { + run_all: false, + run_ios: false, + run_visionos: true, + run_android: false, + run_js: true, + run_e2e: false, + }; + + const stringifiedParams = JSON.stringify(params, null, 2); + fs.writeFileSync(filePath, stringifiedParams); + console.info(`Generated params:\n${stringifiedParams}`); + + return; + } + + console.log(`Should run e2e? ${shouldRunE2E}`); if (pipelineType === 'ALL') { fs.writeFileSync(filePath, JSON.stringify({run_all: true}, null, 2)); return; @@ -179,6 +198,7 @@ function createConfigs(inputPath, outputPath, configFile) { const baseFolder = 'test_workflows'; const testConfigs = { run_ios: ['testIOS.yml'], + run_visionos: ['testVisionOS.yml'], run_android: ['testAndroid.yml'], run_e2e: ['testE2E.yml'], run_all: ['testE2E.yml', 'testJS.yml', 'testAll.yml'],