-
-
Notifications
You must be signed in to change notification settings - Fork 354
chore(samples): Add package scripts for native builds, dsn and testing #4561
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
krystofwoldrich
merged 10 commits into
capture-app-start-errors
from
kw-simplify-local-sample-testing
Feb 21, 2025
Merged
Changes from 8 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
cc9543f
chore(samples): Add package scripts for native builds, dsn and testing
krystofwoldrich c20ac08
Merge branch 'capture-app-start-errors' into kw-simplify-local-sample…
krystofwoldrich f2a14c9
fix ci
krystofwoldrich d9fec19
fix android archive path
krystofwoldrich 6b8f314
fix ios build release
krystofwoldrich 25ab23b
fix(sample-e2e): Fix type errors missing sentry/core and afterAll
krystofwoldrich 20a132e
Merge branch 'kw-fix-bad-merge' into kw-simplify-local-sample-testing
krystofwoldrich 8b2227a
fix IOS_DEVICE empty check
krystofwoldrich d5e8e92
Merge branch 'capture-app-start-errors' into kw-simplify-local-sample…
krystofwoldrich 20e7f55
fix ios archive
krystofwoldrich File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -99,66 +99,39 @@ jobs: | |
| if: ${{ matrix.platform == 'ios' || matrix.platform == 'macos' }} | ||
| working-directory: samples | ||
| run: | | ||
| [[ "${{ matrix.platform }}" == "ios" ]] && cd react-native/ios | ||
| [[ "${{ matrix.platform }}" == "macos" ]] && cd react-native-macos/macos | ||
| [[ "${{ matrix.platform }}" == "ios" ]] && cd react-native | ||
| [[ "${{ matrix.platform }}" == "macos" ]] && cd react-native-macos | ||
|
|
||
| [[ "${{ matrix.build-type }}" == "production" ]] && ENABLE_PROD=1 || ENABLE_PROD=0 | ||
| [[ "${{ matrix.rn-architecture }}" == "new" ]] && ENABLE_NEW_ARCH=1 || ENABLE_NEW_ARCH=0 | ||
| [[ "${{ matrix.build-type }}" == "production" ]] && export ENABLE_PROD=1 || export ENABLE_PROD=0 | ||
| [[ "${{ matrix.rn-architecture }}" == "new" ]] && export ENABLE_NEW_ARCH=1 || export ENABLE_NEW_ARCH=0 | ||
| [[ "${{ matrix.ios-use-frameworks }}" == "dynamic-frameworks" ]] && export USE_FRAMEWORKS=dynamic | ||
| echo "ENABLE_PROD=$ENABLE_PROD" | ||
| echo "ENABLE_NEW_ARCH=$ENABLE_NEW_ARCH" | ||
| PRODUCTION=$ENABLE_PROD RCT_NEW_ARCH_ENABLED=$ENABLE_NEW_ARCH bundle exec pod install | ||
| cat Podfile.lock | grep $RN_SENTRY_POD_NAME | ||
|
|
||
| ./scripts/pod-install.sh | ||
|
|
||
| - name: Build Android App | ||
| if: ${{ matrix.platform == 'android' }} | ||
| working-directory: ${{ env.REACT_NATIVE_SAMPLE_PATH }}/android | ||
| working-directory: ${{ env.REACT_NATIVE_SAMPLE_PATH }} | ||
| run: | | ||
| ../scripts/set-aos-dsn.mjs | ||
|
|
||
| if [[ ${{ matrix.rn-architecture }} == 'new' ]]; then | ||
| perl -i -pe's/newArchEnabled=false/newArchEnabled=true/g' gradle.properties | ||
| echo 'New Architecture enabled' | ||
| elif [[ ${{ matrix.rn-architecture }} == 'legacy' ]]; then | ||
| perl -i -pe's/newArchEnabled=true/newArchEnabled=false/g' gradle.properties | ||
| echo 'Legacy Architecture enabled' | ||
| else | ||
| echo 'No changes for architecture: ${{ matrix.rn-architecture }}' | ||
| fi | ||
| [[ "${{ matrix.build-type }}" == "production" ]] && CONFIG='Release' || CONFIG='Debug' | ||
| echo "Building $CONFIG" | ||
| [[ "${{ matrix.build-type }}" == "production" ]] && TEST_TYPE='release' || TEST_TYPE='debug' | ||
| echo "Building $TEST_TYPE" | ||
| export RN_ARCHITECTURE="${{ matrix.rn-architecture }}" | ||
| [[ "${{ matrix.build-type }}" == "production" ]] && export CONFIG='release' || export CONFIG='debug' | ||
|
|
||
| ./gradlew ":app:assemble$CONFIG" app:assembleAndroidTest -DtestBuildType=$TEST_TYPE -PreactNativeArchitectures=x86 | ||
| ./scripts/set-dsn-aos.mjs | ||
| ./scripts/build-android.sh -PreactNativeArchitectures=x86 | ||
|
|
||
| - name: Build iOS App | ||
| if: ${{ matrix.platform == 'ios' }} | ||
| working-directory: ${{ env.REACT_NATIVE_SAMPLE_PATH }}/ios | ||
| working-directory: ${{ env.REACT_NATIVE_SAMPLE_PATH }} | ||
| run: | | ||
| ../scripts/set-ios-dsn.mjs | ||
| [[ "${{ matrix.build-type }}" == "production" ]] && export CONFIG='Release' || export CONFIG='Debug' | ||
|
|
||
| [[ "${{ matrix.build-type }}" == "production" ]] && CONFIG='Release' || CONFIG='Debug' | ||
| echo "Building $CONFIG" | ||
| mkdir -p "DerivedData" | ||
| derivedData="$(cd "DerivedData" ; pwd -P)" | ||
| set -o pipefail && xcodebuild \ | ||
| -workspace sentryreactnativesample.xcworkspace \ | ||
| -configuration "$CONFIG" \ | ||
| -scheme sentryreactnativesample \ | ||
| -sdk 'iphonesimulator' \ | ||
| -destination 'generic/platform=iOS Simulator' \ | ||
| ONLY_ACTIVE_ARCH=yes \ | ||
| -derivedDataPath "$derivedData" \ | ||
| build \ | ||
| | tee xcodebuild.log \ | ||
| | xcbeautify --quieter --is-ci --disable-colored-output | ||
| ./scripts/set-dsn-ios.mjs | ||
| ./scripts/build-ios.sh | ||
|
|
||
| - name: Build macOS App | ||
| if: ${{ matrix.platform == 'macos' }} | ||
| working-directory: samples/react-native-macos/macos | ||
| run: | | ||
| [[ "${{ matrix.build-type }}" == "production" ]] && CONFIG='Release' || CONFIG='Debug' | ||
| [[ "${{ matrix.build-type }}" == "production" ]] && export CONFIG='Release' || export CONFIG='Debug' | ||
| echo "Building $CONFIG" | ||
| mkdir -p "DerivedData" | ||
| derivedData="$(cd "DerivedData" ; pwd -P)" | ||
|
|
@@ -176,20 +149,17 @@ jobs: | |
| - name: Archive iOS App | ||
| if: ${{ matrix.platform == 'ios' && matrix.rn-architecture == 'new' && matrix.build-type == 'production' && matrix.ios-use-frameworks == 'no-frameworks' }} | ||
| run: | | ||
| cd ${{ env.REACT_NATIVE_SAMPLE_PATH }}/ios/DerivedData/Build/Products/Release-iphonesimulator | ||
| zip -r \ | ||
| ${{ github.workspace }}/${{ env.IOS_APP_ARCHIVE_PATH }} \ | ||
| sentryreactnativesample.app | ||
| ${{ env.REACT_NATIVE_SAMPLE_PATH }}/sentryreactnativesample.app | ||
|
|
||
| - name: Archive Android App | ||
| if: ${{ matrix.platform == 'android' && matrix.rn-architecture == 'new' && matrix.build-type == 'production' }} | ||
| run: | | ||
| mv ${{ env.REACT_NATIVE_SAMPLE_PATH }}/android/app/build/outputs/apk/release/app-release.apk app.apk | ||
| mv ${{ env.REACT_NATIVE_SAMPLE_PATH }}/android/app/build/outputs/apk/androidTest/release/app-release-androidTest.apk app-androidTest.apk | ||
| zip -j \ | ||
| ${{ env.ANDROID_APP_ARCHIVE_PATH }} \ | ||
| app.apk \ | ||
| app-androidTest.apk | ||
| ${{ env.REACT_NATIVE_SAMPLE_PATH }}/app.apk \ | ||
| ${{ env.REACT_NATIVE_SAMPLE_PATH }}/app-androidTest.apk | ||
|
|
||
| - name: Upload iOS APP | ||
| if: ${{ matrix.platform == 'ios' && matrix.rn-architecture == 'new' && matrix.build-type == 'production' && matrix.ios-use-frameworks == 'no-frameworks' }} | ||
|
|
@@ -306,13 +276,14 @@ jobs: | |
| - name: Run Detox iOS Tests | ||
| if: ${{ matrix.platform == 'ios' }} | ||
| working-directory: ${{ env.REACT_NATIVE_SAMPLE_PATH }} | ||
| run: detox test --configuration ci.sim | ||
| run: yarn test-ios | ||
|
|
||
| - name: Run tests on Android | ||
| if: ${{ matrix.platform == 'android' }} | ||
| env: | ||
| # used by Detox ci.android configuration | ||
| ANDROID_AVD_NAME: 'test' # test is default reactivecircus/android-emulator-runner name | ||
| ANDROID_TYPE: 'android.emulator' | ||
| uses: reactivecircus/android-emulator-runner@62dbb605bba737720e10b196cb4220d374026a6d # [email protected] | ||
| with: | ||
| api-level: ${{ env.ANDROID_API_LEVEL }} | ||
|
|
@@ -331,4 +302,4 @@ jobs: | |
| -camera-front none | ||
| -timezone US/Pacific | ||
| working-directory: ${{ env.REACT_NATIVE_SAMPLE_PATH }} | ||
| script: detox test --configuration ci.android | ||
| script: yarn test-android | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| #!/bin/bash | ||
|
|
||
| # Exit on error | ||
| set -e | ||
|
|
||
| thisFilePath=$(dirname "$0") | ||
|
|
||
| echo "USE_FRAMEWORKS=$USE_FRAMEWORKS" | ||
| echo "ENABLE_PROD=$ENABLE_PROD" | ||
| echo "ENABLE_NEW_ARCH=$ENABLE_NEW_ARCH" | ||
|
|
||
| cd "${thisFilePath}/.." | ||
| bundle install | ||
|
|
||
| cd macos | ||
| PRODUCTION=$ENABLE_PROD RCT_NEW_ARCH_ENABLED=$ENABLE_NEW_ARCH bundle exec pod update | ||
|
|
||
| cat Podfile.lock | grep $RN_SENTRY_POD_NAME |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -63,3 +63,5 @@ yarn-error.log | |
| .metro-health-check* | ||
|
|
||
| *.xcarchive | ||
| *.apk | ||
| **/*.app | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
samples/react-native/scripts/build-android-debug-legacy.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| #!/bin/bash | ||
|
|
||
| # Exit on error | ||
| set -e | ||
|
|
||
| thisFilePath=$(dirname "$0") | ||
|
|
||
| export RN_ARCHITECTURE="legacy" | ||
| export CONFIG="debug" | ||
|
|
||
| "${thisFilePath}/build-android.sh" |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.