11name : Build iOS
22
3+ permissions :
4+ contents : read
5+
36on :
47 push :
58 branches :
3336 - ' **/*.podspec'
3437 - ' **/react-native.config.js'
3538 - ' **/nitro.json'
39+ workflow_dispatch :
3640
3741env :
3842 USE_CCACHE : 1
@@ -42,9 +46,13 @@ concurrency:
4246 cancel-in-progress : true
4347
4448jobs :
45- build_new :
46- name : Build iOS Example App (new architecture )
49+ build :
50+ name : Build iOS Example App (${{ matrix.arch }} )
4751 runs-on : macOS-15
52+ strategy :
53+ fail-fast : false
54+ matrix :
55+ arch : [new, old]
4856 steps :
4957 - uses : actions/checkout@v4
5058 - uses : oven-sh/setup-bun@v2
@@ -53,93 +61,47 @@ jobs:
5361 with :
5462 xcode-version : 16.4
5563
56- - name : Install npm dependencies (bun)
57- run : bun install
58-
59- - name : Setup Ruby (bundle)
60- uses : ruby/setup-ruby@v1
61- with :
62- ruby-version : 2.7.2
63- bundler-cache : true
64- working-directory : example/ios
65-
66- - name : Install xcpretty
67- run : gem install xcpretty
68-
69- - name : Restore Pods cache
70- uses : actions/cache@v4
71- with :
72- path : example/ios/Pods
73- key : ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock', '**/Gemfile.lock') }}
74- restore-keys : |
75- ${{ runner.os }}-pods-
76- - name : Install Pods
77- working-directory : example/ios
78- run : pod install
79- - name : Build App
80- working-directory : example/ios
81- run : " set -o pipefail && xcodebuild \
82- CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ \
83- -derivedDataPath build -UseModernBuildSystem=YES \
84- -workspace $$exampleApp$$.xcworkspace \
85- -scheme $$exampleApp$$ \
86- -sdk iphonesimulator \
87- -configuration Debug \
88- -destination 'platform=iOS Simulator,name=iPhone 16' \
89- build \
90- CODE_SIGNING_ALLOWED=NO | xcpretty"
91-
92- build_old :
93- name : Build iOS Example App (old architecture)
94- runs-on : macOS-15
95- steps :
96- - uses : actions/checkout@v4
97- - uses : oven-sh/setup-bun@v2
98-
99- - name : Setup Xcode
100- uses : maxim-lobanov/setup-xcode@v1
101- with :
102- xcode-version : 16.4
103-
104- - name : Install npm dependencies (bun)
64+ - name : Install dependencies (bun)
10565 run : bun install
10666
10767 - name : Disable new architecture in Podfile
68+ if : matrix.arch == 'old'
10869 run : sed -i "" "s/ENV\['RCT_NEW_ARCH_ENABLED'\] = '1'/ENV['RCT_NEW_ARCH_ENABLED'] = '0'/g" example/ios/Podfile
10970
110- - name : Restore buildcache
111- uses : mikehardy/buildcache-action@v2
112- continue-on-error : true
113-
11471 - name : Setup Ruby (bundle)
11572 uses : ruby/setup-ruby@v1
11673 with :
117- ruby-version : 2.7.2
74+ ruby-version : ' 3.2 '
11875 bundler-cache : true
11976 working-directory : example/ios
12077
12178 - name : Install xcpretty
12279 run : gem install xcpretty
12380
124- - name : Restore Pods cache
81+ - name : Cache CocoaPods
12582 uses : actions/cache@v4
12683 with :
127- path : example/ios/Pods
128- key : ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock', '**/Gemfile.lock') }}
84+ path : |
85+ ~/.cocoapods/repos
86+ example/ios/Pods
87+ key : ${{ runner.os }}-pods-${{ hashFiles('example/ios/Podfile.lock') }}
12988 restore-keys : |
13089 ${{ runner.os }}-pods-
90+
13191 - name : Install Pods
13292 working-directory : example/ios
13393 run : pod install
94+
13495 - name : Build App
13596 working-directory : example/ios
136- run : " set -o pipefail && xcodebuild \
137- CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ \
138- -derivedDataPath build -UseModernBuildSystem=YES \
139- -workspace $$exampleApp$$.xcworkspace \
140- -scheme $$exampleApp$$ \
141- -sdk iphonesimulator \
142- -configuration Debug \
143- -destination 'platform=iOS Simulator,name=iPhone 16' \
144- build \
145- CODE_SIGNING_ALLOWED=NO | xcpretty"
97+ run : |
98+ set -o pipefail && xcodebuild \
99+ CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ \
100+ -derivedDataPath build -UseModernBuildSystem=YES \
101+ -workspace $$exampleApp$$.xcworkspace \
102+ -scheme $$exampleApp$$ \
103+ -sdk iphonesimulator \
104+ -configuration Debug \
105+ -destination 'platform=iOS Simulator,name=iPhone 16' \
106+ build \
107+ CODE_SIGNING_ALLOWED=NO | xcpretty
0 commit comments