Skip to content

Commit fdedbd1

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 1d12528 commit fdedbd1

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
@@ -441,6 +441,74 @@ jobs:
441441
steps:
442442
- run_ios_tests
443443

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

.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
@@ -1050,7 +1050,6 @@
10501050
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
10511051
CLANG_ENABLE_OBJC_WEAK = YES;
10521052
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
1053-
CODE_SIGN_STYLE = Automatic;
10541053
CURRENT_PROJECT_VERSION = 1;
10551054
DEBUG_INFORMATION_FORMAT = dwarf;
10561055
DEVELOPMENT_ASSET_PATHS = "\"RNTester-visionOS/Preview Content\"";
@@ -1149,7 +1148,6 @@
11491148
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
11501149
CLANG_ENABLE_OBJC_WEAK = YES;
11511150
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
1152-
CODE_SIGN_STYLE = Automatic;
11531151
COPY_PHASE_STRIP = NO;
11541152
CURRENT_PROJECT_VERSION = 1;
11551153
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)