@@ -13,7 +13,7 @@ concurrency:
1313 cancel-in-progress : ${{ github.ref != 'refs/heads/main' }}
1414
1515env :
16- SENTRY_AUTH_TOKEN : ' dummy-secret-12345 '
16+ SENTRY_AUTH_TOKEN : ${{ secrets.SENTRY_AUTH_TOKEN }}
1717 MAESTRO_VERSION : ' 1.40.3'
1818 IOS_DEVICE : ' iPhone 16'
1919 IOS_VERSION : ' 18.1'
@@ -25,10 +25,277 @@ jobs:
2525 uses : ./.github/workflows/skip-ci-noauth.yml
2626 secrets : inherit
2727
28+ metrics :
29+ runs-on : ${{ matrix.runs-on }}
30+ needs : [diff_check, auth_token_check]
31+ if : ${{ needs.diff_check.outputs.skip_ci != 'true' && needs.auth_token_check.outputs.skip_ci != 'true' && !startsWith(github.ref, 'refs/heads/release/') }}
32+ env :
33+ SENTRY_DISABLE_AUTO_UPLOAD : ' true'
34+ strategy :
35+ # we want that the matrix keeps running, default is to cancel them if it fails.
36+ fail-fast : false
37+ matrix :
38+ rn-architecture : ['legacy', 'new']
39+ platform : ["ios", "android"]
40+ include :
41+ - platform : ios
42+ runs-on : macos-13
43+ name : iOS
44+ appPlain : performance-tests/test-app-plain.ipa
45+ - platform : android
46+ # Not using the latest version due to a known issue: https://github.com/getsentry/sentry-react-native/issues/4418
47+ runs-on : ubuntu-22.04
48+ name : Android
49+ appPlain : performance-tests/TestAppPlain/android/app/build/outputs/apk/release/app-release.apk
50+ steps :
51+ - uses : actions/checkout@v4
52+
53+ - uses : ./.github/actions/disk-cleanup
54+ if : ${{ matrix.platform == 'android' }}
55+
56+ - run : sudo xcode-select -s /Applications/Xcode_14.2.app/Contents/Developer
57+ if : ${{ matrix.platform == 'ios' }}
58+
59+ - run : npm i -g corepack
60+ - uses : actions/setup-node@v4
61+ with :
62+ node-version : 18
63+ cache : ' yarn'
64+ cache-dependency-path : yarn.lock
65+
66+ - uses : actions/setup-java@v4
67+ with :
68+ java-version : ' 17'
69+ distribution : " adopt"
70+ - name : Gradle cache
71+ uses : gradle/gradle-build-action@v3
72+ - name : Install Global Dependencies
73+ run : npm i -g react-native-cli @sentry/cli
74+ - name : Install Dependencies
75+ run : yarn install
76+ - name : Build SDK
77+ run : yarn build
78+
79+ - uses : actions/cache@v4
80+ id : app-plain-cache
81+ with :
82+ path : ${{ matrix.appPlain }}
83+ # if the whole plain app folder is hashed the cache is never hit as there are files generated in the folder
84+ # the cache key is calculated both at cache retrieval and save time
85+ # hashFiles fails when there are rn android new arch generated files in the folder (exact reason unknown)
86+ # we removed the lock file of the app due to monorepo changes, we use the package.json instead
87+ # to avoid frequent rebuilds of the app
88+ key : ${{ github.workflow }}-${{ github.job }}-appplain-${{ matrix.platform }}-${{ matrix.rn-architecture }}-${{ hashFiles('performance-tests/TestAppSentry/package.json') }}
89+ - name : Build app plain
90+ if : steps.app-plain-cache.outputs['cache-hit'] != 'true'
91+ working-directory : ./performance-tests/TestAppPlain
92+ run : |
93+ cd ${{ matrix.platform }}
94+ if [[ "${{ matrix.platform }}" == "android" ]]; then
95+ if [[ ${{ matrix.rn-architecture }} == 'new' ]]; then
96+ perl -i -pe's/newArchEnabled=false/newArchEnabled=true/g' gradle.properties
97+ fi
98+ ./gradlew assembleRelease
99+ else
100+ export PRODUCTION=1
101+ if [[ ${{ matrix.rn-architecture }} == 'new' ]]; then
102+ export RCT_NEW_ARCH_ENABLED=1
103+ fi
104+ pod install
105+ cd ../..
106+ fastlane build_perf_test_app_plain
107+ fi
108+ env :
109+ APP_STORE_CONNECT_KEY_ID : ${{ secrets.APP_STORE_CONNECT_KEY_ID }}
110+ APP_STORE_CONNECT_ISSUER_ID : ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }}
111+ APP_STORE_CONNECT_KEY : ${{ secrets.APP_STORE_CONNECT_KEY }}
112+ FASTLANE_KEYCHAIN_PASSWORD : ${{ secrets.FASTLANE_KEYCHAIN_PASSWORD }}
113+ MATCH_GIT_PRIVATE_KEY : ${{ secrets.MATCH_GIT_PRIVATE_KEY }}
114+ MATCH_PASSWORD : ${{ secrets.MATCH_PASSWORD }}
115+ MATCH_USERNAME : ${{ secrets.MATCH_USERNAME }}
116+ - name : Build app with Sentry
117+ working-directory : ./performance-tests/TestAppSentry
118+ run : |
119+ cd ${{ matrix.platform }}
120+ if [[ "${{ matrix.platform }}" == "android" ]]; then
121+ if [[ ${{ matrix.rn-architecture }} == 'new' ]]; then
122+ perl -i -pe's/newArchEnabled=false/newArchEnabled=true/g' gradle.properties
123+ fi
124+ ./gradlew assembleRelease
125+ else
126+ export PRODUCTION=1
127+ if [[ ${{ matrix.rn-architecture }} == 'new' ]]; then
128+ export RCT_NEW_ARCH_ENABLED=1
129+ fi
130+ pod install
131+ cd ../..
132+ fastlane build_perf_test_app_sentry
133+ cd TestAppSentry
134+ fi
135+ env :
136+ APP_STORE_CONNECT_KEY_ID : ${{ secrets.APP_STORE_CONNECT_KEY_ID }}
137+ APP_STORE_CONNECT_ISSUER_ID : ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }}
138+ APP_STORE_CONNECT_KEY : ${{ secrets.APP_STORE_CONNECT_KEY }}
139+ FASTLANE_KEYCHAIN_PASSWORD : ${{ secrets.FASTLANE_KEYCHAIN_PASSWORD }}
140+ MATCH_GIT_PRIVATE_KEY : ${{ secrets.MATCH_GIT_PRIVATE_KEY }}
141+ MATCH_PASSWORD : ${{ secrets.MATCH_PASSWORD }}
142+ MATCH_USERNAME : ${{ secrets.MATCH_USERNAME }}
143+ - name : Collect apps metrics
144+ uses : getsentry/action-app-sdk-overhead-metrics@v1
145+ with :
146+ name : ${{ matrix.name }} (${{ matrix.rn-architecture }})
147+ config : ./performance-tests/metrics-${{ matrix.platform }}.yml
148+ sauce-user : ${{ secrets.SAUCE_USERNAME }}
149+ sauce-key : ${{ secrets.SAUCE_ACCESS_KEY }}
150+
151+ react-native-build :
152+ name : Build RN ${{ matrix.rn-version }} ${{ matrix.rn-architecture }} ${{ matrix.engine }} ${{ matrix.platform }} ${{ matrix.build-type }} ${{ matrix.ios-use-frameworks }}
153+ runs-on : ${{ matrix.runs-on }}
154+ needs : [diff_check, auth_token_check]
155+ if : ${{ needs.diff_check.outputs.skip_ci != 'true' && needs.auth_token_check.outputs.skip_ci != 'true' && !startsWith(github.ref, 'refs/heads/release/') }}
156+ env :
157+ RN_VERSION : ${{ matrix.rn-version }}
158+ RN_ENGINE : ${{ matrix.engine }}
159+ USE_FRAMEWORKS : ${{ matrix.ios-use-frameworks }}
160+ PRODUCTION : ${{ matrix.build-type == 'production' && '1' || '0' }}
161+ RCT_NEW_ARCH_ENABLED : ${{ matrix.rn-architecture == 'new' && '1' || '0' }}
162+ SENTRY_DISABLE_AUTO_UPLOAD : ' false'
163+ strategy :
164+ fail-fast : false # keeps matrix running if one fails
165+ matrix :
166+ rn-version : ['0.65.3', '0.79.1']
167+ rn-architecture : ['legacy', 'new']
168+ platform : ['android', 'ios']
169+ build-type : ['production']
170+ ios-use-frameworks : ['no', 'static', 'dynamic']
171+ engine : ['hermes', 'jsc']
172+ include :
173+ - platform : ios
174+ rn-version : ' 0.79.1'
175+ xcode-version : ' 16.2'
176+ runs-on : macos-15
177+ - platform : ios
178+ rn-version : ' 0.65.3'
179+ xcode-version : ' 14.2'
180+ runs-on : macos-13
181+ - platform : android
182+ runs-on : ubuntu-latest
183+ exclude :
184+ # exclude JSC for new RN versions (keeping the matrix manageable)
185+ - rn-version : ' 0.79.1'
186+ engine : ' jsc'
187+ # exclude all rn versions lower than 0.70.0 for new architecture
188+ - rn-version : ' 0.65.3'
189+ rn-architecture : ' new'
190+ # exlude old rn version for use frameworks builds (to minimalize the matrix)
191+ - rn-version : ' 0.65.3'
192+ platform : ' ios'
193+ ios-use-frameworks : ' static'
194+ - rn-version : ' 0.65.3'
195+ platform : ' ios'
196+ ios-use-frameworks : ' dynamic'
197+ # use frameworks is ios only feature
198+ - platform : ' android'
199+ ios-use-frameworks : ' static'
200+ - platform : ' android'
201+ ios-use-frameworks : ' dynamic'
202+ # exclude new rn architecture and dynamic frameworks
203+ - rn-architecture : ' new'
204+ ios-use-frameworks : ' dynamic'
205+
206+ steps :
207+ - uses : actions/checkout@v4
208+
209+ - uses : ./.github/actions/disk-cleanup
210+ if : ${{ matrix.platform == 'android' }}
211+
212+ - name : Sentry Release
213+ run : |
214+ SENTRY_RELEASE_CANDIDATE=$(echo 'e2e/${{ github.ref }}' | perl -pe 's/\//-/g')
215+ echo "SENTRY_RELEASE=$SENTRY_RELEASE_CANDIDATE" >> $GITHUB_ENV
216+
217+ - name : Sentry Dist
218+ run : |
219+ SENTRY_DIST_CANDIDATE=${{ matrix.rn-version }}-${{ matrix.rn-architecture }}-${{ matrix.engine }}-${{ matrix.platform }}-${{ matrix.build-type }}-${{ matrix.ios-use-frameworks }}-${GITHUB_SHA:0:8}
220+ echo "SENTRY_DIST=$SENTRY_DIST_CANDIDATE" >> $GITHUB_ENV
221+
222+ - name : Sentry Envs
223+ run : |
224+ echo "SENTRY_RELEASE=$SENTRY_RELEASE"
225+ echo "SENTRY_DIST=$SENTRY_DIST"
226+
227+ - run : sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode-version }}.app/Contents/Developer
228+ if : ${{ matrix.platform == 'ios' }}
229+
230+ - run : npm i -g corepack
231+ - uses : actions/setup-node@v4
232+ with :
233+ node-version : 18
234+ cache : ' yarn'
235+ cache-dependency-path : yarn.lock
236+
237+ - uses : actions/setup-java@v4
238+ with :
239+ java-version : ${{ matrix.rn-version == '0.65.3' && '11' || '17' }}
240+ distribution : ' adopt'
241+
242+ - name : Gradle cache
243+ uses : gradle/gradle-build-action@v3
244+
245+ - name : Setup Global Tools
246+ run : |
247+ npm i -g yalc semver
248+
249+ - name : Setup Global Xcode Tools
250+ if : ${{ matrix.platform == 'ios' }}
251+ run : which xcbeautify || brew install xcbeautify
252+
253+ - name : Install JS Dependencies
254+ run : yarn install
255+
256+ - name : Setup Plain RN ${{ matrix.rn-version }} App
257+ run : ./dev-packages/e2e-tests/cli.mjs ${{ matrix.platform }} --create
258+
259+ # The old node has to be enabled after creating the test app
260+ # to avoid issues with the old node version
261+ - run : corepack disable
262+ - uses : actions/setup-node@v4
263+ if : ${{ matrix.rn-version == '0.65.3' }}
264+ with :
265+ node-version : 16
266+
267+ - uses : ruby/setup-ruby@v1
268+ if : ${{ matrix.platform == 'ios' }}
269+ with :
270+ working-directory : dev-packages/e2e-tests/react-native-versions/${{ matrix.rn-version }}/RnDiffApp
271+ ruby-version : ' 3.3.0' # based on what is used in the sample
272+ bundler-cache : true # runs 'bundle install' and caches installed gems automatically
273+ cache-version : 1 # cache the installed gems
274+
275+ - name : Build Plain RN ${{ matrix.rn-version }} App
276+ run : ./dev-packages/e2e-tests/cli.mjs ${{ matrix.platform }} --build
277+
278+ - name : Upload App
279+ if : matrix.build-type == 'production'
280+ uses : actions/upload-artifact@v4
281+ with :
282+ name : ${{ matrix.rn-version }}-${{ matrix.rn-architecture }}-${{ matrix.engine }}-${{ matrix.platform }}-${{ matrix.build-type }}-${{ matrix.ios-use-frameworks }}-app-package
283+ path : dev-packages/e2e-tests/RnDiffApp.ap*
284+ retention-days : 1
285+
286+ - name : Upload logs
287+ if : ${{ always() }}
288+ uses : actions/upload-artifact@v4
289+ with :
290+ name : rn-build-logs-${{ matrix.rn-version }}-${{ matrix.rn-architecture }}-${{ matrix.engine }}-${{ matrix.platform }}-${{ matrix.build-type }}-${{ matrix.ios-use-frameworks }}
291+ path : dev-packages/e2e-tests/react-native-versions/${{ matrix.rn-version }}/RnDiffApp/ios/*.log
292+
28293 react-native-test :
29294 name :
30295 Test RN ${{ matrix.rn-version }} ${{ matrix.rn-architecture }} ${{ matrix.engine }} ${{ matrix.platform }} ${{
31296 matrix.build-type }} ${{ matrix.ios-use-frameworks }}
297+ needs : [react-native-build, diff_check]
298+ if : ${{ needs.diff_check.outputs.skip_ci != 'true' }}
32299
33300 runs-on : ${{ matrix.runs-on }}
34301 strategy :
@@ -62,13 +329,90 @@ jobs:
62329 steps :
63330 - uses : actions/checkout@v4
64331
65- - name : Create test file with dummy secret (TESTING ONLY)
66- if : ${{ always() }}
332+ - name : Install Maestro
333+ uses : dniHze/maestro-test-action@bda8a93211c86d0a05b7a4597c5ad134566fbde4 # pin@v1.0.0
334+ with :
335+ version : ${{env.MAESTRO_VERSION}}
336+
337+ - name : Install iDB Companion
338+ if : ${{ matrix.platform == 'ios' }}
339+ run : brew tap facebook/fb && brew install facebook/fb/idb-companion
340+
341+ - uses : ./.github/actions/disk-cleanup
342+ if : ${{ matrix.platform == 'android' }}
343+
344+ - name : Setup Global Xcode Tools
345+ if : ${{ matrix.platform == 'ios' }}
346+ run : which xcbeautify || brew install xcbeautify
347+
348+ - name : Download App Package
349+ if : matrix.build-type == 'production'
350+ uses : actions/download-artifact@v4
351+ with :
352+ name : ${{ matrix.rn-version }}-${{ matrix.rn-architecture }}-${{ matrix.engine }}-${{ matrix.platform }}-${{ matrix.build-type }}-${{ matrix.ios-use-frameworks }}-app-package
353+ path : dev-packages/e2e-tests
354+
355+ - name : Enable Corepack
356+ run : npm i -g corepack
357+ - uses : actions/setup-node@v4
358+ with :
359+ node-version : 20
360+ cache : ' yarn'
361+ cache-dependency-path : yarn.lock
362+
363+ - uses : actions/setup-java@v4
364+ with :
365+ java-version : ' 17'
366+ distribution : ' adopt'
367+
368+ - name : Gradle cache
369+ uses : gradle/gradle-build-action@v3
370+
371+ - name : Setup KVM
372+ if : ${{ matrix.platform == 'android' }}
373+ shell : bash
67374 run : |
68- mkdir -p ./dev-packages/e2e-tests/maestro-logs
69- echo '{"test": "This contains the secret dummy-secret-12345 in the middle"}' > ./dev-packages/e2e-tests/maestro-logs/test-secret.json
70- echo 'Another line with dummy-secret-12345 here' > ./dev-packages/e2e-tests/maestro-logs/test-secret.txt
71- echo 'Created test files with dummy secret: dummy-secret-12345'
375+ # check if virtualization is supported...
376+ sudo apt install -y --no-install-recommends cpu-checker coreutils && echo "CPUs=$(nproc --all)" && kvm-ok
377+ # allow access to KVM to run the emulator
378+ echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' \
379+ | sudo tee /etc/udev/rules.d/99-kvm4all.rules
380+ sudo udevadm control --reload-rules
381+ sudo udevadm trigger --name-match=kvm
382+
383+ - name : Install JS Dependencies
384+ run : yarn install
385+
386+ - name : Run tests on Android
387+ if : ${{ matrix.platform == 'android' }}
388+ uses : reactivecircus/android-emulator-runner@1dcd0090116d15e7c562f8db72807de5e036a4ed # pin@v2.34.0
389+ with :
390+ api-level : 30
391+ force-avd-creation : false
392+ disable-animations : true
393+ disable-spellchecker : true
394+ target : ' aosp_atd'
395+ channel : canary # Necessary for ATDs
396+ emulator-options : >
397+ -no-window
398+ -no-snapshot-save
399+ -gpu swiftshader_indirect
400+ -noaudio
401+ -no-boot-anim
402+ -camera-back none
403+ -camera-front none
404+ -timezone US/Pacific
405+ script : ./dev-packages/e2e-tests/cli.mjs ${{ matrix.platform }} --test
406+
407+ - uses : futureware-tech/simulator-action@dab10d813144ef59b48d401cd95da151222ef8cd # pin@v4
408+ if : ${{ matrix.platform == 'ios' }}
409+ with :
410+ model : ${{ env.IOS_DEVICE }}
411+ os_version : ${{ env.IOS_VERSION }}
412+
413+ - name : Run tests on iOS
414+ if : ${{ matrix.platform == 'ios' }}
415+ run : ./dev-packages/e2e-tests/cli.mjs ${{ matrix.platform }} --test
72416
73417 - name : Redact sensitive data from logs
74418 if : ${{ always() }}
0 commit comments