1
1
name : CI
2
+
2
3
on : [push, pull_request]
3
4
4
5
concurrency :
@@ -13,62 +14,147 @@ jobs:
13
14
14
15
with :
15
16
node-version : 18.x
16
- - name : Get yarn cache directory path
17
- id : yarn-cache-dir-path
18
- run : echo "::set-output name=dir::$(yarn cache dir)"
19
- - uses : actions/cache@v4
20
- id : yarn-cache
17
+
18
+ # Cache Yarn dependencies
19
+ - name : Cache Yarn dependencies
20
+ uses : actions/cache@v4
21
21
with :
22
- path : ${{ steps.yarn-cache-dir-path.outputs.dir }}
22
+ path : ${{ github.workspace }}/node_modules
23
23
key : ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
24
24
restore-keys : |
25
25
${{ runner.os }}-yarn-
26
- - name : Run test
26
+
27
+ # Install dependencies and run lint
28
+ - name : Install dependencies and run lint
27
29
run : |
28
30
yarn
29
31
yarn lint
30
32
31
- build-ios :
32
- runs-on : macos-latest
33
+ sed -i '' 's/"newArchEnabled": true/"newArchEnabled": false/g' path/to/your/file.json
33
34
35
+ build-ios-old-arch :
36
+ runs-on : macos-latest
34
37
steps :
35
38
# Checkout the code
36
39
- name : Checkout the code
37
40
uses : actions/checkout@v4
38
41
39
- # Set up Node.js environment
42
+ # Disable new architecture in app config
43
+ - name : Disable New Architecture in JSON
44
+ working-directory : apps/external-display-example
45
+ run : |
46
+ sed -i '' 's/"newArchEnabled": true/"newArchEnabled": false/g' app.json
47
+
48
+ # Set up Node.js
40
49
- name : Set up Node.js
41
50
42
51
with :
43
52
node-version : 18.x
44
53
45
- # Cache Yarn dependencies to speed up the build
46
- - name : Get yarn cache directory path
47
- id : yarn-cache-dir-path
48
- run : echo "::set-output name=dir::$(yarn cache dir)"
49
-
50
- - uses : actions/cache@v4
51
- id : yarn-cache
54
+ # Cache Yarn dependencies
55
+ - name : Cache Yarn dependencies
56
+ uses : actions/cache@v4
52
57
with :
53
- path : ${{ steps.yarn-cache-dir-path.outputs.dir }}
58
+ path : ${{ github.workspace }}/node_modules
54
59
key : ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
55
60
restore-keys : |
56
61
${{ runner.os }}-yarn-
57
62
63
+ # Cache CocoaPods dependencies
64
+ - name : Cache CocoaPods
65
+ uses : actions/cache@v4
66
+ with :
67
+ path : |
68
+ apps/external-display-example/ios/Pods
69
+ apps/external-display-example/ios/Podfile.lock
70
+ key : ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
71
+ restore-keys : |
72
+ ${{ runner.os }}-pods-
73
+
58
74
# Install dependencies
59
75
- name : Install dependencies
60
76
run : yarn
61
77
62
78
# Prebuild the iOS folder for Expo
63
79
- name : Prebuild iOS with Expo
64
80
working-directory : apps/external-display-example
81
+ run : yarn expo prebuild --platform ios
82
+
83
+ # Install xcpretty for better build output
84
+ - name : Install xcpretty
85
+ run : gem install xcpretty
86
+
87
+ # Cache Xcode derived data
88
+ - name : Cache Xcode Derived Data
89
+ uses : actions/cache@v4
90
+ with :
91
+ path : apps/external-display-example/ios/build
92
+ key : build-${{ github.sha }}
93
+
94
+ # Build the iOS app using Xcode (with xcpretty)
95
+ - name : Build iOS App (Debug) with xcpretty
96
+ working-directory : apps/external-display-example/ios
65
97
run : |
66
- yarn expo prebuild --platform ios
98
+ set -o pipefail && xcodebuild \
99
+ -workspace externaldisplayexample.xcworkspace \
100
+ -scheme externaldisplayexample \
101
+ -configuration Debug \
102
+ -sdk iphonesimulator \
103
+ -derivedDataPath build | xcpretty
104
+
105
+ build-ios-new-arch :
106
+ runs-on : macos-latest
107
+ steps :
108
+ # Checkout the code
109
+ - name : Checkout the code
110
+ uses : actions/checkout@v4
111
+
112
+ # Set up Node.js
113
+ - name : Set up Node.js
114
+
115
+ with :
116
+ node-version : 18.x
117
+
118
+ # Cache Yarn dependencies
119
+ - name : Cache Yarn dependencies
120
+ uses : actions/cache@v4
121
+ with :
122
+ path : ${{ github.workspace }}/node_modules
123
+ key : ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
124
+ restore-keys : |
125
+ ${{ runner.os }}-yarn-
126
+
127
+ # Cache CocoaPods dependencies
128
+ - name : Cache CocoaPods
129
+ uses : actions/cache@v4
130
+ with :
131
+ path : |
132
+ apps/external-display-example/ios/Pods
133
+ apps/external-display-example/ios/Podfile.lock
134
+ key : ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
135
+ restore-keys : |
136
+ ${{ runner.os }}-pods-
137
+
138
+ # Install dependencies
139
+ - name : Install dependencies
140
+ run : yarn
141
+
142
+ # Prebuild the iOS folder for Expo
143
+ - name : Prebuild iOS with Expo
144
+ working-directory : apps/external-display-example
145
+ run : yarn expo prebuild --platform ios
67
146
68
147
# Install xcpretty for better build output
69
148
- name : Install xcpretty
70
149
run : gem install xcpretty
71
150
151
+ # Cache Xcode derived data
152
+ - name : Cache Xcode Derived Data
153
+ uses : actions/cache@v4
154
+ with :
155
+ path : apps/external-display-example/ios/build
156
+ key : build-${{ github.sha }}
157
+
72
158
# Build the iOS app using Xcode (with xcpretty)
73
159
- name : Build iOS App (Debug) with xcpretty
74
160
working-directory : apps/external-display-example/ios
@@ -80,15 +166,20 @@ jobs:
80
166
-sdk iphonesimulator \
81
167
-derivedDataPath build | xcpretty
82
168
83
- build-android :
169
+ build-android-old-arch :
84
170
runs-on : ubuntu-latest
85
-
86
171
steps :
87
172
# Checkout the code
88
173
- name : Checkout the code
89
174
uses : actions/checkout@v4
175
+
176
+ # Disable new architecture in app config
177
+ - name : Disable New Architecture in JSON
178
+ working-directory : apps/external-display-example
179
+ run : |
180
+ sed -i '' 's/"newArchEnabled": true/"newArchEnabled": false/g' app.json
90
181
91
- # Set up Node.js environment
182
+ # Set up Node.js
92
183
- name : Set up Node.js
93
184
94
185
with :
@@ -101,30 +192,91 @@ jobs:
101
192
distribution : ' temurin'
102
193
java-version : ' 17'
103
194
104
- # Cache Yarn dependencies to speed up the build
105
- - name : Get yarn cache directory path
106
- id : yarn-cache-dir-path
107
- run : echo "::set-output name=dir::$(yarn cache dir)"
195
+ # Cache Yarn dependencies
196
+ - name : Cache Yarn dependencies
197
+ uses : actions/cache@v4
198
+ with :
199
+ path : ${{ github.workspace }}/node_modules
200
+ key : ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
201
+ restore-keys : |
202
+ ${{ runner.os }}-yarn-
108
203
109
- - uses : actions/cache@v4
110
- id : yarn-cache
204
+ # Cache Gradle dependencies
205
+ - name : Cache Gradle
206
+ uses : actions/cache@v4
111
207
with :
112
- path : ${{ steps.yarn-cache-dir-path.outputs.dir }}
208
+ path : |
209
+ ~/.gradle/caches
210
+ ~/.gradle/wrapper
211
+ key : gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
212
+ restore-keys : |
213
+ gradle-${{ runner.os }}-
214
+
215
+ # Install dependencies
216
+ - name : Install dependencies
217
+ run : yarn
218
+
219
+ # Prebuild the Android folder for Expo
220
+ - name : Prebuild Android with Expo
221
+ working-directory : apps/external-display-example
222
+ run : yarn expo prebuild --platform android
223
+
224
+ # Build the APK using Gradle (without running on a device)
225
+ - name : Build Android APK
226
+ working-directory : apps/external-display-example/android
227
+ run : ./gradlew assembleDebug
228
+
229
+
230
+ build-android-new-arch :
231
+ runs-on : ubuntu-latest
232
+ steps :
233
+ # Checkout the code
234
+ - name : Checkout the code
235
+ uses : actions/checkout@v4
236
+
237
+ # Set up Node.js
238
+ - name : Set up Node.js
239
+
240
+ with :
241
+ node-version : 18.x
242
+
243
+ # Install Java 17
244
+ - name : Set up Java 17
245
+ uses : actions/setup-java@v4
246
+ with :
247
+ distribution : ' temurin'
248
+ java-version : ' 17'
249
+
250
+ # Cache Yarn dependencies
251
+ - name : Cache Yarn dependencies
252
+ uses : actions/cache@v4
253
+ with :
254
+ path : ${{ github.workspace }}/node_modules
113
255
key : ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
114
256
restore-keys : |
115
257
${{ runner.os }}-yarn-
116
258
259
+ # Cache Gradle dependencies
260
+ - name : Cache Gradle
261
+ uses : actions/cache@v4
262
+ with :
263
+ path : |
264
+ ~/.gradle/caches
265
+ ~/.gradle/wrapper
266
+ key : gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
267
+ restore-keys : |
268
+ gradle-${{ runner.os }}-
269
+
117
270
# Install dependencies
118
271
- name : Install dependencies
119
272
run : yarn
120
273
121
274
# Prebuild the Android folder for Expo
122
275
- name : Prebuild Android with Expo
123
276
working-directory : apps/external-display-example
124
- run : |
125
- yarn expo prebuild --platform android
277
+ run : yarn expo prebuild --platform android
126
278
127
- # Build the APK without running on a device
279
+ # Build the APK using Gradle ( without running on a device)
128
280
- name : Build Android APK
129
281
working-directory : apps/external-display-example/android
130
282
run : ./gradlew assembleDebug
0 commit comments