@@ -99,66 +99,39 @@ jobs:
9999 if : ${{ matrix.platform == 'ios' || matrix.platform == 'macos' }}
100100 working-directory : samples
101101 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
104104
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
107107 [[ "${{ 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
112110
113111 - name : Build Android App
114112 if : ${{ matrix.platform == 'android' }}
115- working-directory : ${{ env.REACT_NATIVE_SAMPLE_PATH }}/android
113+ working-directory : ${{ env.REACT_NATIVE_SAMPLE_PATH }}
116114 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'
132117
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
134120
135121 - name : Build iOS App
136122 if : ${{ matrix.platform == 'ios' }}
137- working-directory : ${{ env.REACT_NATIVE_SAMPLE_PATH }}/ios
123+ working-directory : ${{ env.REACT_NATIVE_SAMPLE_PATH }}
138124 run : |
139- ../scripts/set-ios-dsn.mjs
125+ [[ "${{ matrix.build-type }}" == "production" ]] && export CONFIG='Release' || export CONFIG='Debug'
140126
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
156129
157130 - name : Build macOS App
158131 if : ${{ matrix.platform == 'macos' }}
159132 working-directory : samples/react-native-macos/macos
160133 run : |
161- [[ "${{ matrix.build-type }}" == "production" ]] && CONFIG='Release' || CONFIG='Debug'
134+ [[ "${{ matrix.build-type }}" == "production" ]] && export CONFIG='Release' || export CONFIG='Debug'
162135 echo "Building $CONFIG"
163136 mkdir -p "DerivedData"
164137 derivedData="$(cd "DerivedData" ; pwd -P)"
@@ -175,21 +148,19 @@ jobs:
175148
176149 - name : Archive iOS App
177150 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 }}
178152 run : |
179- cd ${{ env.REACT_NATIVE_SAMPLE_PATH }}/ios/DerivedData/Build/Products/Release-iphonesimulator
180153 zip -r \
181154 ${{ github.workspace }}/${{ env.IOS_APP_ARCHIVE_PATH }} \
182155 sentryreactnativesample.app
183156
184157 - name : Archive Android App
185158 if : ${{ matrix.platform == 'android' && matrix.rn-architecture == 'new' && matrix.build-type == 'production' }}
186159 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
189160 zip -j \
190161 ${{ 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
193164
194165 - name : Upload iOS APP
195166 if : ${{ matrix.platform == 'ios' && matrix.rn-architecture == 'new' && matrix.build-type == 'production' && matrix.ios-use-frameworks == 'no-frameworks' }}
@@ -306,13 +277,14 @@ jobs:
306277 - name : Run Detox iOS Tests
307278 if : ${{ matrix.platform == 'ios' }}
308279 working-directory : ${{ env.REACT_NATIVE_SAMPLE_PATH }}
309- run : detox test --configuration ci.sim
280+ run : yarn test-ios
310281
311282 - name : Run tests on Android
312283 if : ${{ matrix.platform == 'android' }}
313284 env :
314285 # used by Detox ci.android configuration
315286 ANDROID_AVD_NAME : ' test' # test is default reactivecircus/android-emulator-runner name
287+ ANDROID_TYPE : ' android.emulator'
316288 uses : reactivecircus/android-emulator-runner@62dbb605bba737720e10b196cb4220d374026a6d # pin@v2.33.0
317289 with :
318290 api-level : ${{ env.ANDROID_API_LEVEL }}
@@ -331,4 +303,4 @@ jobs:
331303 -camera-front none
332304 -timezone US/Pacific
333305 working-directory : ${{ env.REACT_NATIVE_SAMPLE_PATH }}
334- script : detox test --configuration ci. android
306+ script : yarn test- android
0 commit comments