17
17
- name : Set up Node.js
18
18
uses : actions/setup-node@v3.6.0
19
19
with :
20
- node-version : 16
20
+ node-version : 18.16.1
21
21
cache : yarn
22
22
- name : Install JS dependencies
23
23
run : yarn
@@ -32,17 +32,26 @@ jobs:
32
32
- name : Set up Node.js
33
33
uses : actions/setup-node@v3.6.0
34
34
with :
35
- node-version : 16
35
+ node-version : 18.16.1
36
36
cache : yarn
37
37
- name : Install JS dependencies
38
38
run : |
39
39
yarn
40
40
- name : Test Next Storage
41
- uses : gradle/gradle-build-action@v2.4.2
41
+ uses : gradle/gradle-build-action@v2
42
42
with :
43
43
gradle-version : wrapper
44
44
arguments : react-native-async-storage_async-storage:test
45
45
build-root-directory : example/android
46
+ - name : Build e2e binary
47
+ run : |
48
+ yarn build:e2e:android
49
+ - name : Upload e2e binary
50
+ if : github.event_name == 'pull_request'
51
+ uses : actions/upload-artifact@v3
52
+ with :
53
+ name : app-release.apk
54
+ path : example/android/app/build/outputs/apk/release/
46
55
ios :
47
56
name : iOS
48
57
runs-on : macos-latest
58
67
- name : Set up Node.js
59
68
uses : actions/setup-node@v3.6.0
60
69
with :
61
- node-version : 16
70
+ node-version : 18.16.1
62
71
cache : yarn
63
72
- name : Set up environment
64
73
run : |
@@ -74,18 +83,18 @@ jobs:
74
83
run : |
75
84
pod install
76
85
working-directory : example/ios
77
- - name : Boot simulator
78
- run : |
79
- ./scripts/ios_e2e.sh 'run_simulator'
80
- - name : Build
86
+ - name : Build e2e binary
81
87
run : |
82
88
yarn build:e2e:ios
83
- - name : Test
84
- if : false
85
- run : |
86
- yarn test:e2e:ios
89
+ - name : Upload e2e binary
90
+ uses : actions/upload-artifact@v3
91
+ if : github.event_name == 'pull_request'
92
+ with :
93
+ name : ReactTestApp.app
94
+ path : example/ios/build/Build/Products/Release-iphonesimulator/ReactTestApp.app
87
95
macos :
88
96
name : macOS
97
+ if : false # TEMP, Remove once done this PR
89
98
runs-on : macos-latest
90
99
steps :
91
100
- name : Checkout
99
108
- name : Set up Node.js
100
109
uses : actions/setup-node@v3.6.0
101
110
with :
102
- node-version : 16
111
+ node-version : 18.16.1
103
112
cache : yarn
104
113
- name : Install JS dependencies
105
114
run : |
@@ -120,6 +129,7 @@ jobs:
120
129
yarn test:e2e:macos
121
130
windows :
122
131
name : Windows
132
+ if : false # TEMP, Remove once done this PR
123
133
runs-on : windows-2022
124
134
steps :
125
135
- name : Set up MSBuild
@@ -131,7 +141,7 @@ jobs:
131
141
- name : Set up Node.js
132
142
uses : actions/setup-node@v3.6.0
133
143
with :
134
- node-version : 16
144
+ node-version : 18.16.1
135
145
cache : yarn
136
146
- name : Install JS dependencies
137
147
run : |
@@ -142,6 +152,87 @@ jobs:
142
152
- name : Build
143
153
run : |
144
154
yarn react-native run-windows --release --arch x64 --logging --no-packager --no-launch --no-deploy --msbuildprops "BundleEntryFile=index.ts" --no-telemetry
155
+
156
+
157
+ e2e-tests :
158
+ name : Run e2e tests
159
+ needs : [review, android, ios]
160
+ if : github.event_name == 'pull_request'
161
+ strategy :
162
+ matrix :
163
+ platform : [ android, ios ]
164
+ runs-on : macos-latest
165
+ steps :
166
+ - name : Checkout
167
+ uses : actions/checkout@v3
168
+ - name : Set up Node.js
169
+ uses : actions/setup-node@v3.6.0
170
+ with :
171
+ node-version : 18.16.1
172
+ cache : yarn
173
+ - name : Install JS dependencies
174
+ run : |
175
+ yarn
176
+ - name : Gradle cache
177
+ uses : gradle/gradle-build-action@v2
178
+ - name : Start Appium server
179
+ run : |
180
+ yarn appium --config example/appium.config.js &
181
+ - name : Wait for appium boot
182
+ run : |
183
+ sleep 5
184
+
185
+ # ios part
186
+ - name : Download iOS binary
187
+ uses : actions/download-artifact@v3
188
+ if : matrix.platform == 'ios'
189
+ with :
190
+ name : ReactTestApp.app
191
+ path : example/ios/build/Build/Products/Release-iphonesimulator/ReactTestApp.app
192
+ - uses : futureware-tech/simulator-action@v2
193
+ if : matrix.platform == 'ios'
194
+ with :
195
+ model : ' iPhone 14'
196
+ - name : Run iOS e2e
197
+ if : matrix.platform == 'ios'
198
+ run : |
199
+ yarn test:e2e:ios
200
+
201
+ # android part
202
+ - name : Download android binary
203
+ uses : actions/download-artifact@v3
204
+ if : matrix.platform == 'android'
205
+ with :
206
+ name : app-release.apk
207
+ path : example/android/app/build/outputs/apk/release/
208
+ - name : AVD cache
209
+ if : matrix.platform == 'android'
210
+ uses : actions/cache@v3
211
+ id : avd-cache
212
+ with :
213
+ path : |
214
+ ~/.android/avd/*
215
+ ~/.android/adb*
216
+ key : avd-29
217
+ - name : create AVD and generate snapshot for caching
218
+ if : matrix.platform == 'android' && steps.avd-cache.outputs.cache-hit != 'true'
219
+ uses : reactivecircus/android-emulator-runner@v2
220
+ with :
221
+ api-level : 29
222
+ force-avd-creation : false
223
+ emulator-options : -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
224
+ disable-animations : false
225
+ script : echo "Generated AVD snapshot for caching."
226
+ - name : Run Android e2e tests
227
+ if : matrix.platform == 'android'
228
+ uses : reactivecircus/android-emulator-runner@v2
229
+ with :
230
+ api-level : 29
231
+ force-avd-creation : false
232
+ emulator-options : -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
233
+ disable-animations : true
234
+ script : yarn test:e2e:android
235
+
145
236
release :
146
237
name : Release
147
238
needs : [review, android, ios, macos, windows]
@@ -155,7 +246,7 @@ jobs:
155
246
- name : Set up Node.js
156
247
uses : actions/setup-node@v3.6.0
157
248
with :
158
- node-version : 16
249
+ node-version : 18.16.1
159
250
cache : yarn
160
251
- name : Install JS dependencies
161
252
run : |
0 commit comments