diff --git a/.circleci/config.yml b/.circleci/config.yml index a642711e33d1af..ff5476dd49dff4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -71,7 +71,7 @@ jobs: name: "[Main or Stable] Create input for config to test everything" command: | mkdir -p /tmp/circleci/ - echo '{ "run_all": true }' > /tmp/circleci/pipeline_config.json + node ./scripts/circleci/pipeline_selection.js filter-jobs - when: condition: not: diff --git a/.circleci/configurations/executors.yml b/.circleci/configurations/executors.yml index eb1fecfaaefd2f..02d750b9773b28 100644 --- a/.circleci/configurations/executors.yml +++ b/.circleci/configurations/executors.yml @@ -36,3 +36,17 @@ executors: resource_class: macos.m1.medium.gen1 environment: - RCT_BUILD_HERMES_FROM_SOURCE: true + reactnativeios-lts: + <<: *defaults + macos: + xcode: '14.3.1' + 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: + - RCT_BUILD_HERMES_FROM_SOURCE: true diff --git a/.circleci/configurations/jobs.yml b/.circleci/configurations/jobs.yml index b97865fc45061b..7c9d5497e1bb29 100644 --- a/.circleci/configurations/jobs.yml +++ b/.circleci/configurations/jobs.yml @@ -437,6 +437,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: Build Hermes # ------------------------- diff --git a/.circleci/configurations/test_workflows/testAll.yml b/.circleci/configurations/test_workflows/testAll.yml index 59c2eefa5a22aa..ab5c6f3f7b52ee 100644 --- a/.circleci/configurations/test_workflows/testAll.yml +++ b/.circleci/configurations/test_workflows/testAll.yml @@ -11,8 +11,8 @@ tag: test dry_run: true - prepare_hermes_workspace - - build_android: - release_type: "dry-run" + # - build_android: + # release_type: "dry-run" - build_hermesc_linux: requires: - prepare_hermes_workspace @@ -39,15 +39,13 @@ # Build a release package on every untagged commit, but do not publish to npm. release_type: "dry-run" requires: - - build_android + # - build_android - build_hermesc_linux - build_hermes_macos - build_hermesc_windows - - test_android: - requires: - - build_android - ## Disabled to land removing react-native/template. Re-enable once switched over - ## to Helloworld. + # - test_android: + # requires: + # - build_android # - test_android_template: # requires: # - build_npm_package diff --git a/.circleci/configurations/test_workflows/testAndroid.yml b/.circleci/configurations/test_workflows/testAndroid.yml index 5f14bc096402e4..fe03be61fbde57 100644 --- a/.circleci/configurations/test_workflows/testAndroid.yml +++ b/.circleci/configurations/test_workflows/testAndroid.yml @@ -1,6 +1,7 @@ tests_android: when: and: + - equal: [ true, false ] # Disable for visionOS - equal: [ false, << pipeline.parameters.run_release_workflow >> ] - equal: [ false, << pipeline.parameters.run_nightly_workflow >> ] jobs: diff --git a/.circleci/configurations/test_workflows/testIOS.yml b/.circleci/configurations/test_workflows/testIOS.yml index e6b9092b7a984e..be86e64fee6c93 100644 --- a/.circleci/configurations/test_workflows/testIOS.yml +++ b/.circleci/configurations/test_workflows/testIOS.yml @@ -1,6 +1,7 @@ test_ios: when: and: + - equal: [ true, false ] # Disable for visionOS - equal: [ false, << pipeline.parameters.run_release_workflow >> ] - equal: [ false, << pipeline.parameters.run_nightly_workflow >> ] jobs: 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/.github/workflows/ios-tests.yml b/.github/workflows/ios-tests.yml new file mode 100644 index 00000000000000..e69de29bb2d1d6 diff --git a/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj b/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj index 0da49c8760faf9..6b220ce22fd713 100644 --- a/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj +++ b/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj @@ -1053,7 +1053,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\""; @@ -1152,7 +1151,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 5312caa03f6dc6..a6d90fbacb211d 100644 --- a/scripts/circleci/pipeline_selection.js +++ b/scripts/circleci/pipeline_selection.js @@ -155,6 +155,24 @@ function _computeAndSavePipelineParameters( 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( @@ -167,6 +185,7 @@ function _computeAndSavePipelineParameters( const params = { run_all: false, run_ios: pipelineType === 'RUN_IOS', + run_visionos: true, run_android: pipelineType === 'RUN_ANDROID', run_js: pipelineType === 'RUN_JS', run_e2e: shouldRunE2E, @@ -194,6 +213,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: ['testJS.yml', 'testAll.yml'], @@ -243,5 +263,5 @@ function filterJobs(outputPath) { return; } } - _computeAndSavePipelineParameters('ALL', outputPath, shouldRunE2E); + _computeAndSavePipelineParameters('VISION_OS', outputPath, shouldRunE2E); }