7
7
branches : [main]
8
8
9
9
jobs :
10
- android :
11
- name : Build Android App
12
- runs-on : ubuntu-latest
10
+ ios-build :
11
+ name : iOS Build
12
+ runs-on : macos-latest
13
+ defaults :
14
+ run :
15
+ working-directory : example
13
16
14
17
env :
15
18
SKIP_YARN_COREPACK_CHECK : 0
16
19
17
20
steps :
18
- - uses : actions/checkout@v4
19
-
20
- - name : Setup Java
21
- uses : actions/setup-java@v4
22
- with :
23
- distribution : ' zulu'
24
- java-version : ' 17'
21
+ - name : Checkout repository
22
+ uses : actions/checkout@v4
25
23
26
24
- name : Setup Node.js
27
25
uses : actions/setup-node@v4
28
26
with :
29
- node-version : ' lts/* '
27
+ node-version : ' 22 '
30
28
cache : ' yarn'
29
+ cache-dependency-path : example/yarn.lock
30
+
31
+ - name : Setup Ruby
32
+ uses : ruby/setup-ruby@v1
33
+ with :
34
+ ruby-version : ' 3.2'
35
+ bundler-cache : true
36
+
37
+ - name : Cache CocoaPods
38
+ uses : actions/cache@v4
39
+ with :
40
+ path : |
41
+ example/swift/Pods
42
+ key : ${{ runner.os }}-pods-${{ hashFiles('example/swift/Podfile.lock') }}
43
+ restore-keys : |
44
+ ${{ runner.os }}-pods-
31
45
32
46
- name : Install root dependencies
33
47
run : yarn install
34
48
35
49
- name : Install example dependencies
50
+ run : yarn install
51
+
52
+ - name : Install pods
36
53
run : |
37
- cd example
38
- yarn install
39
- cd ..
54
+ cd swift
55
+ pod install
40
56
41
- - name : Build Android App
57
+ - name : Install Maestro CLI
42
58
run : |
43
- cd example/kotlin
44
- ./gradlew assembleDebug
59
+ curl -Ls "https://get.maestro.mobile.dev" | bash
60
+ brew tap facebook/fb
61
+ brew install facebook/fb/idb-companion
45
62
46
- ios :
47
- name : Build iOS App
48
- runs-on : macos-latest
63
+ - name : Add Maestro to path
64
+ run : echo "${HOME}/.maestro/bin" >> $GITHUB_PATH
65
+
66
+ - name : Start packager
67
+ run : yarn start &
68
+
69
+ - name : Build iOS App (Release)
70
+ run : |
71
+ cd swift
72
+ xcodebuild -workspace SwiftExample.xcworkspace -scheme SwiftExample -configuration Release -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 15' build CODE_SIGNING_ALLOWED=NO
73
+
74
+ - name : Setup iOS simulator
75
+ run : |
76
+ UDID=$(xcrun simctl list devices | grep "iPhone" | grep "Booted" | head -1 | grep -E -o -i "([0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12})")
77
+ if [ -z "$UDID" ]; then
78
+ UDID=$(xcrun simctl list devices available | grep "iPhone" | head -1 | grep -E -o -i "([0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12})")
79
+ xcrun simctl boot "${UDID}"
80
+ fi
81
+ open -a Simulator
82
+ xcrun simctl launch "${UDID}" com.callstack.reactnativebrownfield.SwiftExample
83
+
84
+ - name : Run iOS tests
85
+ run : |
86
+ export MAESTRO_DRIVER_STARTUP_TIMEOUT=1500000
87
+ export MAESTRO_WAIT_TIMEOUT=10000
88
+ yarn test:e2e:ios
89
+
90
+ android-build :
91
+ name : Android Build
92
+ runs-on : ubuntu-latest
93
+ defaults :
94
+ run :
95
+ working-directory : example
49
96
50
97
env :
51
98
SKIP_YARN_COREPACK_CHECK : 0
52
99
53
100
steps :
54
- - uses : actions/checkout@v4
101
+ - name : Checkout repository
102
+ uses : actions/checkout@v4
55
103
56
104
- name : Setup Node.js
57
105
uses : actions/setup-node@v4
58
106
with :
59
- node-version : ' lts/* '
107
+ node-version : ' 22 '
60
108
cache : ' yarn'
109
+ cache-dependency-path : example/yarn.lock
61
110
62
- - name : Setup Ruby
63
- uses : ruby /setup-ruby@v1
111
+ - name : Setup Java
112
+ uses : actions /setup-java@v4
64
113
with :
65
- ruby-version : ' 3.2 '
66
- bundler-cache : true
114
+ distribution : ' zulu '
115
+ java-version : ' 17 '
67
116
68
117
- name : Install root dependencies
69
118
run : yarn install
70
119
71
120
- name : Install example dependencies
72
- run : |
73
- cd example
74
- yarn install
75
- cd ..
121
+ run : yarn install
76
122
77
- - name : Install pods
78
- run : |
79
- cd example/swift
80
- pod install
123
+ - name : Start packager
124
+ run : yarn start &
81
125
82
- - name : Build iOS App
126
+ - name : Install Maestro CLI
83
127
run : |
84
- cd example/swift
85
- xcodebuild -workspace SwiftExample.xcworkspace -scheme SwiftExample -configuration Debug -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 15' build CODE_SIGNING_ALLOWED=NO
128
+ curl -Ls "https://get.maestro.mobile.dev" | bash
129
+
130
+ - name : Add Maestro to path
131
+ run : echo "${HOME}/.maestro/bin" >> $GITHUB_PATH
132
+
133
+ - name : Create AVD and generate snapshot for caching
134
+ uses : reactivecircus/android-emulator-runner@v2
135
+ with :
136
+ target : aosp_atd
137
+ api-level : 30
138
+ arch : x86
139
+ ram-size : 4096M
140
+ channel : canary
141
+ profile : pixel
142
+ avd-name : Pixel_3a_API_30_AOSP
143
+ force-avd-creation : false
144
+ emulator-options : -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
145
+ emulator-boot-timeout : 12000
146
+ disable-animations : false
147
+ working-directory : example/kotlin
148
+ script : |
149
+ chmod +x ./gradlew
150
+ ./gradlew :app:installRelease
151
+ cd ..
152
+ yarn test:e2e:android
0 commit comments