@@ -99,66 +99,39 @@ jobs:
99
99
if : ${{ matrix.platform == 'ios' || matrix.platform == 'macos' }}
100
100
working-directory : samples
101
101
run : |
102
- [[ "${{ matrix.platform }}" == "ios" ]] && cd react-native/ios
103
- [[ "${{ matrix.platform }}" == "macos" ]] && cd react-native-macos/macos
102
+ [[ "${{ matrix.platform }}" == "ios" ]] && cd react-native
103
+ [[ "${{ matrix.platform }}" == "macos" ]] && cd react-native-macos
104
104
105
- [[ "${{ matrix.build-type }}" == "production" ]] && ENABLE_PROD=1 || ENABLE_PROD=0
106
- [[ "${{ matrix.rn-architecture }}" == "new" ]] && ENABLE_NEW_ARCH=1 || ENABLE_NEW_ARCH=0
105
+ [[ "${{ matrix.build-type }}" == "production" ]] && export ENABLE_PROD=1 || export ENABLE_PROD=0
106
+ [[ "${{ matrix.rn-architecture }}" == "new" ]] && export ENABLE_NEW_ARCH=1 || export ENABLE_NEW_ARCH=0
107
107
[[ "${{ matrix.ios-use-frameworks }}" == "dynamic-frameworks" ]] && export USE_FRAMEWORKS=dynamic
108
- echo "ENABLE_PROD=$ENABLE_PROD"
109
- echo "ENABLE_NEW_ARCH=$ENABLE_NEW_ARCH"
110
- PRODUCTION=$ENABLE_PROD RCT_NEW_ARCH_ENABLED=$ENABLE_NEW_ARCH bundle exec pod install
111
- cat Podfile.lock | grep $RN_SENTRY_POD_NAME
108
+
109
+ ./scripts/pod-install.sh
112
110
113
111
- name : Build Android App
114
112
if : ${{ matrix.platform == 'android' }}
115
- working-directory : ${{ env.REACT_NATIVE_SAMPLE_PATH }}/android
113
+ working-directory : ${{ env.REACT_NATIVE_SAMPLE_PATH }}
116
114
run : |
117
- ../scripts/set-aos-dsn.mjs
118
-
119
- if [[ ${{ matrix.rn-architecture }} == 'new' ]]; then
120
- perl -i -pe's/newArchEnabled=false/newArchEnabled=true/g' gradle.properties
121
- echo 'New Architecture enabled'
122
- elif [[ ${{ matrix.rn-architecture }} == 'legacy' ]]; then
123
- perl -i -pe's/newArchEnabled=true/newArchEnabled=false/g' gradle.properties
124
- echo 'Legacy Architecture enabled'
125
- else
126
- echo 'No changes for architecture: ${{ matrix.rn-architecture }}'
127
- fi
128
- [[ "${{ matrix.build-type }}" == "production" ]] && CONFIG='Release' || CONFIG='Debug'
129
- echo "Building $CONFIG"
130
- [[ "${{ matrix.build-type }}" == "production" ]] && TEST_TYPE='release' || TEST_TYPE='debug'
131
- echo "Building $TEST_TYPE"
115
+ export RN_ARCHITECTURE="${{ matrix.rn-architecture }}"
116
+ [[ "${{ matrix.build-type }}" == "production" ]] && export CONFIG='release' || export CONFIG='debug'
132
117
133
- ./gradlew ":app:assemble$CONFIG" app:assembleAndroidTest -DtestBuildType=$TEST_TYPE -PreactNativeArchitectures=x86
118
+ ./scripts/set-dsn-aos.mjs
119
+ ./scripts/build-android.sh -PreactNativeArchitectures=x86
134
120
135
121
- name : Build iOS App
136
122
if : ${{ matrix.platform == 'ios' }}
137
- working-directory : ${{ env.REACT_NATIVE_SAMPLE_PATH }}/ios
123
+ working-directory : ${{ env.REACT_NATIVE_SAMPLE_PATH }}
138
124
run : |
139
- ../scripts/set-ios-dsn.mjs
125
+ [[ "${{ matrix.build-type }}" == "production" ]] && export CONFIG='Release' || export CONFIG='Debug'
140
126
141
- [[ "${{ matrix.build-type }}" == "production" ]] && CONFIG='Release' || CONFIG='Debug'
142
- echo "Building $CONFIG"
143
- mkdir -p "DerivedData"
144
- derivedData="$(cd "DerivedData" ; pwd -P)"
145
- set -o pipefail && xcodebuild \
146
- -workspace sentryreactnativesample.xcworkspace \
147
- -configuration "$CONFIG" \
148
- -scheme sentryreactnativesample \
149
- -sdk 'iphonesimulator' \
150
- -destination 'generic/platform=iOS Simulator' \
151
- ONLY_ACTIVE_ARCH=yes \
152
- -derivedDataPath "$derivedData" \
153
- build \
154
- | tee xcodebuild.log \
155
- | xcbeautify --quieter --is-ci --disable-colored-output
127
+ ./scripts/set-dsn-ios.mjs
128
+ ./scripts/build-ios.sh
156
129
157
130
- name : Build macOS App
158
131
if : ${{ matrix.platform == 'macos' }}
159
132
working-directory : samples/react-native-macos/macos
160
133
run : |
161
- [[ "${{ matrix.build-type }}" == "production" ]] && CONFIG='Release' || CONFIG='Debug'
134
+ [[ "${{ matrix.build-type }}" == "production" ]] && export CONFIG='Release' || export CONFIG='Debug'
162
135
echo "Building $CONFIG"
163
136
mkdir -p "DerivedData"
164
137
derivedData="$(cd "DerivedData" ; pwd -P)"
@@ -175,21 +148,19 @@ jobs:
175
148
176
149
- name : Archive iOS App
177
150
if : ${{ matrix.platform == 'ios' && matrix.rn-architecture == 'new' && matrix.build-type == 'production' && matrix.ios-use-frameworks == 'no-frameworks' }}
151
+ working-directory : ${{ env.REACT_NATIVE_SAMPLE_PATH }}
178
152
run : |
179
- cd ${{ env.REACT_NATIVE_SAMPLE_PATH }}/ios/DerivedData/Build/Products/Release-iphonesimulator
180
153
zip -r \
181
154
${{ github.workspace }}/${{ env.IOS_APP_ARCHIVE_PATH }} \
182
155
sentryreactnativesample.app
183
156
184
157
- name : Archive Android App
185
158
if : ${{ matrix.platform == 'android' && matrix.rn-architecture == 'new' && matrix.build-type == 'production' }}
186
159
run : |
187
- mv ${{ env.REACT_NATIVE_SAMPLE_PATH }}/android/app/build/outputs/apk/release/app-release.apk app.apk
188
- mv ${{ env.REACT_NATIVE_SAMPLE_PATH }}/android/app/build/outputs/apk/androidTest/release/app-release-androidTest.apk app-androidTest.apk
189
160
zip -j \
190
161
${{ env.ANDROID_APP_ARCHIVE_PATH }} \
191
- app.apk \
192
- app-androidTest.apk
162
+ ${{ env.REACT_NATIVE_SAMPLE_PATH }}/ app.apk \
163
+ ${{ env.REACT_NATIVE_SAMPLE_PATH }}/ app-androidTest.apk
193
164
194
165
- name : Upload iOS APP
195
166
if : ${{ matrix.platform == 'ios' && matrix.rn-architecture == 'new' && matrix.build-type == 'production' && matrix.ios-use-frameworks == 'no-frameworks' }}
@@ -306,13 +277,14 @@ jobs:
306
277
- name : Run Detox iOS Tests
307
278
if : ${{ matrix.platform == 'ios' }}
308
279
working-directory : ${{ env.REACT_NATIVE_SAMPLE_PATH }}
309
- run : detox test --configuration ci.sim
280
+ run : yarn test-ios
310
281
311
282
- name : Run tests on Android
312
283
if : ${{ matrix.platform == 'android' }}
313
284
env :
314
285
# used by Detox ci.android configuration
315
286
ANDROID_AVD_NAME : ' test' # test is default reactivecircus/android-emulator-runner name
287
+ ANDROID_TYPE : ' android.emulator'
316
288
uses :
reactivecircus/android-emulator-runner@62dbb605bba737720e10b196cb4220d374026a6d # [email protected]
317
289
with :
318
290
api-level : ${{ env.ANDROID_API_LEVEL }}
@@ -331,4 +303,4 @@ jobs:
331
303
-camera-front none
332
304
-timezone US/Pacific
333
305
working-directory : ${{ env.REACT_NATIVE_SAMPLE_PATH }}
334
- script : detox test --configuration ci. android
306
+ script : yarn test- android
0 commit comments