Skip to content

Commit 48aa76e

Browse files
committed
feat: implement visionOS CI (#54)
feat: use Xcode beta globally feat: use callstack/hermes-visionos fork feat: test Hermes feat: reset cache keys fix: use callstack/hermes fix: use correct hermes source tarball fix: use never xcode version test only JSC fix: change Xcode version fix: use m1 executor feat: add cocoapods cache fix: remove hermes from cache keys fix: rbenv reset cache test: use 15.2 fix: run visionos CI on every PR (#62) chore: disable some of upstream pipelines (#33) * chore: disable some of upstream pipelines * tests: update snapshot for visionOS * chore: disable more jobs, fix isVisionOS * fix: Keyboard.js, adjust pipeline_selection.js * feat: run iOS tests every night chore: disable android tests (#39) fix: prevent from running the testAll.yml on main (#41) fix: ci on main (#44) fix: remove windows jobs (#126) * fix: remove windows jobs * fix: sync jobs.yml
1 parent f865094 commit 48aa76e

File tree

10 files changed

+118
-12
lines changed

10 files changed

+118
-12
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171
name: "[Main or Stable] Create input for config to test everything"
7272
command: |
7373
mkdir -p /tmp/circleci/
74-
echo '{ "run_all": true }' > /tmp/circleci/pipeline_config.json
74+
node ./scripts/circleci/pipeline_selection.js filter-jobs
7575
- when:
7676
condition:
7777
not:

.circleci/configurations/executors.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,17 @@ executors:
3636
resource_class: macos.m1.medium.gen1
3737
environment:
3838
- RCT_BUILD_HERMES_FROM_SOURCE: true
39+
reactnativeios-lts:
40+
<<: *defaults
41+
macos:
42+
xcode: '14.3.1'
43+
resource_class: macos.x86.medium.gen2
44+
environment:
45+
- RCT_BUILD_HERMES_FROM_SOURCE: true
46+
reactnative-visionos:
47+
<<: *defaults
48+
resource_class: macos.m1.medium.gen1
49+
macos:
50+
xcode: '15.2'
51+
environment:
52+
- RCT_BUILD_HERMES_FROM_SOURCE: true

.circleci/configurations/jobs.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,74 @@ jobs:
437437
steps:
438438
- run_ios_tests
439439

440+
# -------------------------
441+
# JOBS: Test visionOS RNTester
442+
# -------------------------
443+
test_visionos_rntester:
444+
445+
parameters:
446+
jsengine:
447+
default: "JSC"
448+
description: Which JavaScript engine to use. Must be one of "Hermes", "JSC".
449+
type: enum
450+
enum: ["Hermes", "JSC"]
451+
architecture:
452+
default: "OldArch"
453+
description: Which React Native architecture to use. Must be one of "OldArch", "NewArch".
454+
type: enum
455+
enum: ["NewArch", "OldArch"]
456+
use_frameworks:
457+
default: "StaticLibraries"
458+
description: The dependency building and linking strategy to use. Must be one of "StaticLibraries", "DynamicFrameworks"
459+
type: enum
460+
enum: ["StaticLibraries", "DynamicFrameworks"]
461+
ruby_version:
462+
default: "2.6.10"
463+
description: The version of ruby that must be used
464+
type: string
465+
run_unit_tests:
466+
description: whether unit tests should run or not.
467+
default: false
468+
type: boolean
469+
executor:
470+
description: The executor to use
471+
default: reactnative-visionos
472+
type: string
473+
executor: << parameters.executor >>
474+
steps:
475+
- checkout_code_with_cache
476+
- run_yarn
477+
- setup_ruby:
478+
ruby_version: << parameters.ruby_version >>
479+
- with_xcodebuild_cache:
480+
steps:
481+
- run:
482+
name: "Install pods"
483+
command: |
484+
if [[ << parameters.architecture >> == "NewArch" ]]; then
485+
export RCT_NEW_ARCH_ENABLED=1
486+
fi
487+
488+
if [[ << parameters.jsengine >> == "JSC" ]]; then
489+
export USE_HERMES=0
490+
fi
491+
492+
if [[ << parameters.use_frameworks >> == "DynamicFrameworks" ]]; then
493+
export USE_FRAMEWORKS=dynamic
494+
fi
495+
496+
cd packages/rn-tester
497+
498+
bundle install
499+
bundle exec pod install
500+
- run:
501+
name: "Build rn-tester"
502+
command: |
503+
xcodebuild build \
504+
-workspace packages/rn-tester/RNTesterPods.xcworkspace \
505+
-scheme RNTester-visionOS \
506+
-sdk xrsimulator
507+
440508
# -------------------------
441509
# JOBS: Build Hermes
442510
# -------------------------

.circleci/configurations/test_workflows/testAll.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
tag: test
1212
dry_run: true
1313
- prepare_hermes_workspace
14-
- build_android:
15-
release_type: "dry-run"
14+
# - build_android:
15+
# release_type: "dry-run"
1616
- build_hermesc_linux:
1717
requires:
1818
- prepare_hermes_workspace
@@ -39,15 +39,13 @@
3939
# Build a release package on every untagged commit, but do not publish to npm.
4040
release_type: "dry-run"
4141
requires:
42-
- build_android
42+
# - build_android
4343
- build_hermesc_linux
4444
- build_hermes_macos
4545
- build_hermesc_windows
46-
- test_android:
47-
requires:
48-
- build_android
49-
## Disabled to land removing react-native/template. Re-enable once switched over
50-
## to Helloworld.
46+
# - test_android:
47+
# requires:
48+
# - build_android
5149
# - test_android_template:
5250
# requires:
5351
# - build_npm_package

.circleci/configurations/test_workflows/testAndroid.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
tests_android:
22
when:
33
and:
4+
- equal: [ true, false ] # Disable for visionOS
45
- equal: [ false, << pipeline.parameters.run_release_workflow >> ]
56
- equal: [ false, << pipeline.parameters.run_nightly_workflow >> ]
67
jobs:

.circleci/configurations/test_workflows/testIOS.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
test_ios:
22
when:
33
and:
4+
- equal: [ true, false ] # Disable for visionOS
45
- equal: [ false, << pipeline.parameters.run_release_workflow >> ]
56
- equal: [ false, << pipeline.parameters.run_nightly_workflow >> ]
67
jobs:
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
test_visionos:
2+
jobs:
3+
- test_visionos_rntester:
4+
matrix:
5+
parameters:
6+
architecture: ["OldArch", "NewArch"]

.github/workflows/ios-tests.yml

Whitespace-only changes.

packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1053,7 +1053,6 @@
10531053
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
10541054
CLANG_ENABLE_OBJC_WEAK = YES;
10551055
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
1056-
CODE_SIGN_STYLE = Automatic;
10571056
CURRENT_PROJECT_VERSION = 1;
10581057
DEBUG_INFORMATION_FORMAT = dwarf;
10591058
DEVELOPMENT_ASSET_PATHS = "\"RNTester-visionOS/Preview Content\"";
@@ -1152,7 +1151,6 @@
11521151
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
11531152
CLANG_ENABLE_OBJC_WEAK = YES;
11541153
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
1155-
CODE_SIGN_STYLE = Automatic;
11561154
COPY_PHASE_STRIP = NO;
11571155
CURRENT_PROJECT_VERSION = 1;
11581156
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";

scripts/circleci/pipeline_selection.js

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,24 @@ function _computeAndSavePipelineParameters(
155155
return;
156156
}
157157

158+
// Custom config for visionOS
159+
if (pipelineType === 'VISION_OS') {
160+
const params = {
161+
run_all: false,
162+
run_ios: false,
163+
run_visionos: true,
164+
run_android: false,
165+
run_js: true,
166+
run_e2e: false,
167+
};
168+
169+
const stringifiedParams = JSON.stringify(params, null, 2);
170+
fs.writeFileSync(filePath, stringifiedParams);
171+
console.info(`Generated params:\n${stringifiedParams}`);
172+
173+
return;
174+
}
175+
158176
console.log(`Should run e2e? ${shouldRunE2E}`);
159177
if (pipelineType === 'ALL') {
160178
fs.writeFileSync(
@@ -167,6 +185,7 @@ function _computeAndSavePipelineParameters(
167185
const params = {
168186
run_all: false,
169187
run_ios: pipelineType === 'RUN_IOS',
188+
run_visionos: true,
170189
run_android: pipelineType === 'RUN_ANDROID',
171190
run_js: pipelineType === 'RUN_JS',
172191
run_e2e: shouldRunE2E,
@@ -194,6 +213,7 @@ function createConfigs(inputPath, outputPath, configFile) {
194213
const baseFolder = 'test_workflows';
195214
const testConfigs = {
196215
run_ios: ['testIOS.yml'],
216+
run_visionos: ['testVisionOS.yml'],
197217
run_android: ['testAndroid.yml'],
198218
run_e2e: ['testE2E.yml'],
199219
run_all: ['testJS.yml', 'testAll.yml'],
@@ -243,5 +263,5 @@ function filterJobs(outputPath) {
243263
return;
244264
}
245265
}
246-
_computeAndSavePipelineParameters('ALL', outputPath, shouldRunE2E);
266+
_computeAndSavePipelineParameters('VISION_OS', outputPath, shouldRunE2E);
247267
}

0 commit comments

Comments
 (0)