Skip to content

Commit 0dc7107

Browse files
committed
Merge branch 'master' into chore/fix-ios-sample
# Conflicts: # sample/ios/Podfile # sample/ios/sample.xcodeproj/project.pbxproj
2 parents 100906b + ebee3e4 commit 0dc7107

23 files changed

+2444
-32
lines changed

.github/workflows/ci.yml

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,17 @@ jobs:
3737

3838
test-ios:
3939
needs: test-rn
40-
runs-on: macos-13
40+
runs-on: macos-14
41+
env:
42+
RCT_NEW_ARCH_ENABLED: 0
43+
RCT_NO_LAUNCH_PACKAGER: 1
44+
USE_METRO_BUNDLER: 0
45+
FORCE_BUNDLING: 1
4146

4247
steps:
4348
- uses: maxim-lobanov/setup-xcode@v1
4449
with:
45-
xcode-version: '15.2'
50+
xcode-version: '16.1'
4651

4752
- name: Checkout
4853
uses: actions/checkout@v2
@@ -52,6 +57,12 @@ jobs:
5257
with:
5358
node-version: ${{ env.NODE_JS_VERSION }}
5459

60+
- name: Setup Ruby
61+
uses: ruby/setup-ruby@v1
62+
with:
63+
ruby-version: '3.2'
64+
bundler-cache: true # Caches gems
65+
5566
- name: Install SDK Dependencies
5667
run: yarn install --frozen-lockfile
5768

@@ -62,13 +73,34 @@ jobs:
6273
working-directory: ./sample
6374
run: npm ci --legacy-peer-deps
6475

65-
- name: Install pods
76+
- name: Bundle install (Ruby gems)
6677
working-directory: ./sample
67-
run: cd ios && pod install
78+
run: |
79+
bundle config set path 'vendor/bundle'
80+
bundle install --jobs 4 --retry 3
81+
82+
- name: Install pods (via bundler)
83+
working-directory: ./sample/ios
84+
run: |
85+
pod deintegrate
86+
pod cache clean --all
87+
bundle exec pod install --repo-update
88+
89+
- name: Clean Xcode Build Artifacts
90+
run: |
91+
rm -rf ~/Library/Developer/Xcode/DerivedData/*
6892
6993
- name: Run tests
70-
working-directory: ./sample
71-
run: cd ios && xcodebuild -workspace sample.xcworkspace -scheme "sample" -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 14' test
94+
working-directory: ./sample/ios
95+
run: |
96+
set -o pipefail && \
97+
xcodebuild \
98+
-workspace sample.xcworkspace \
99+
-scheme "sample" \
100+
-sdk iphonesimulator \
101+
-destination 'platform=iOS Simulator,OS=latest,name=iPhone 16 Pro' \
102+
-only-testing:sampleTests \
103+
test | bundle exec xcpretty && exit ${PIPESTATUS[0]}
72104
73105
test-android:
74106
needs: test-rn

sample/Gemfile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
source 'https://rubygems.org'
22

33
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
4-
ruby ">= 2.6.10"
4+
ruby ">= 3.2.0"
55

66
# Exclude problematic versions of cocoapods and activesupport that causes build failures.
7-
gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
8-
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
9-
gem 'xcodeproj', '< 1.26.0'
10-
gem 'concurrent-ruby', '< 1.3.4'
7+
gem 'cocoapods', '~> 1.16.2'
8+
gem 'xcodeproj', '~> 1.27.0'
9+
gem 'activesupport', '>= 7.0'
10+
gem 'concurrent-ruby'
1111

1212
# Ruby 3.4.0 has removed some libraries from the standard library.
1313
gem 'bigdecimal'
1414
gem 'logger'
1515
gem 'benchmark'
1616
gem 'mutex_m'
17+
gem 'xcpretty'

sample/ios/Podfile

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Resolve react_native_pods.rb com node para allow hoisting
1+
# Resolve react_native_pods.rb with Node to allow hoisting
22
require Pod::Executable.execute_command('node', ['-p',
33
'require.resolve(
44
"react-native/scripts/react_native_pods.rb",
@@ -31,17 +31,25 @@ target 'sample' do
3131
:new_arch_enabled => $RCT_NEW_ARCH_ENABLED,
3232
)
3333

34+
# ✅ Test target: inherit search paths only, not full settings
35+
target 'sampleTests' do
36+
inherit! :search_paths
37+
end
38+
39+
# ✅ Post-install hook (safe for CircleCI and macOS 13+)
3440
post_install do |installer|
3541
react_native_post_install(
3642
installer,
3743
config[:reactNativePath],
3844
:mac_catalyst_enabled => false
3945
)
40-
46+
4147
# ========================================
4248
# APPLY NEW ARCHITECTURE CONFIGURATION
4349
# ========================================
4450
installer.pods_project.targets.each do |target|
51+
next if target.name.to_s.include?('Tests')
52+
4553
target.build_configurations.each do |config|
4654
# Apply New Architecture flags
4755
if $RCT_NEW_ARCH_ENABLED
@@ -55,15 +63,15 @@ target 'sample' do
5563
# Use Legacy Architecture
5664
config.build_settings['RCT_NEW_ARCH_ENABLED'] = '0'
5765
end
58-
66+
5967
# Fix modular headers issues
6068
config.build_settings['CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES'] = 'YES'
6169
config.build_settings['DEFINES_MODULE'] = 'YES'
62-
70+
6371
# Additional fixes for React Native 0.81
6472
config.build_settings['GCC_WARN_INHIBIT_ALL_WARNINGS'] = 'YES'
6573
config.build_settings['CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER'] = 'NO'
66-
74+
6775
# C++ settings
6876
config.build_settings['CLANG_CXX_LANGUAGE_STANDARD'] = 'c++20'
6977
config.build_settings['CLANG_CXX_LIBRARY'] = 'libc++'

0 commit comments

Comments
 (0)