Skip to content

Commit b868b53

Browse files
authored
Merge 3ddf4dd into 3ebcc5d
2 parents 3ebcc5d + 3ddf4dd commit b868b53

File tree

285 files changed

+33464
-237
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

285 files changed

+33464
-237
lines changed

.eslintignore

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# Ignore build generated dir
22
dist
33

4-
# Ignore sample folder
4+
# Ignore standalone apps
55
sample
6+
sample-new-architecture
7+
test/perf/TestApp*
68

79
# Ignore dangerfile
8-
dangerfile.js
10+
dangerfile.js

.github/workflows/buildandtest.yml

+40-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ jobs:
1414
steps:
1515
- uses: actions/checkout@v3
1616
- uses: actions/setup-node@v3
17-
17+
with:
18+
node-version: 14
1819
- uses: actions/cache@v3
1920
id: cache
2021
with:
@@ -42,12 +43,50 @@ jobs:
4243
- name: Lint
4344
run: yarn lint
4445

46+
job_lint_sample_new_arch:
47+
name: Lint Sample
48+
runs-on: ubuntu-latest
49+
steps:
50+
- uses: actions/checkout@v3
51+
- uses: actions/cache@v3
52+
id: cache
53+
with:
54+
path: sample-new-architecture/node_modules
55+
key: ${{ runner.os }}-${{ github.sha }}
56+
- name: Install Dependencies
57+
if: steps.cache.outputs['cache-hit'] != 'true'
58+
run: yarn install
59+
working-directory: sample-new-architecture
60+
- name: Lint Sample
61+
run: yarn lint
62+
working-directory: sample-new-architecture
63+
64+
job_check_integrity:
65+
name: Check package integrity
66+
runs-on: ubuntu-latest
67+
steps:
68+
- uses: actions/checkout@v3
69+
- uses: actions/cache@v3
70+
id: cache
71+
with:
72+
path: node_modules
73+
key: ${{ runner.os }}-${{ github.sha }}
74+
- name: Save initial lock file
75+
run: cp yarn.lock yarn.lock.initial
76+
- name: Install Dependencies (update lock if necessary)
77+
run: yarn install
78+
- name: Check lock file integrity
79+
run: |
80+
["$(diff yarn.lock.initial yarn.lock)" -eq ""]
81+
4582
job_build:
4683
name: Build
4784
runs-on: ubuntu-latest
4885
steps:
4986
- uses: actions/checkout@v3
5087
- uses: actions/setup-node@v3
88+
with:
89+
node-version: 14
5190
- uses: actions/cache@v3
5291
id: cache
5392
with:

.github/workflows/codegen.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Codegen
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- release/**
8+
pull_request:
9+
10+
jobs:
11+
codegen:
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
platform: ["android"] # "ios" will be added after codegen is fixed
16+
include:
17+
- platform: android
18+
command: |
19+
cd sample-new-architecture/android
20+
./gradlew generateCodegenArtifactsFromSchema
21+
steps:
22+
- uses: actions/checkout@v3
23+
- uses: actions/setup-node@v3
24+
with:
25+
node-version: 14
26+
- uses: actions/cache@v3
27+
id: cache
28+
with:
29+
path: sample-new-architecture/node_modules
30+
key: ${{ runner.os }}-${{ github.sha }}
31+
- name: Install Dependencies
32+
if: steps.cache.outputs['cache-hit'] != 'true'
33+
run: |
34+
cd sample-new-architecture
35+
yarn install
36+
- name: Codegen
37+
run: ${{ matrix.command }}

.github/workflows/e2e.yml

+122
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
branches: [main]
66
pull_request:
77

8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
812
env:
913
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
1014

@@ -140,3 +144,121 @@ jobs:
140144
path: |
141145
./sample/*.log
142146
./sample/*.png
147+
148+
metrics:
149+
runs-on: macos-latest
150+
strategy:
151+
# we want that the matrix keeps running, default is to cancel them if it fails.
152+
fail-fast: false
153+
matrix:
154+
rn-architecture: ['legacy', 'new']
155+
platform: ["ios", "android"]
156+
include:
157+
- platform: ios
158+
name: iOS
159+
appPlain: test/perf/test-app-plain.ipa
160+
- platform: android
161+
name: Android
162+
appPlain: test/perf/TestAppPlain/android/app/build/outputs/apk/release/app-release.apk
163+
steps:
164+
- uses: actions/checkout@v3
165+
- uses: actions/setup-node@v3
166+
with:
167+
node-version: "14"
168+
- uses: actions/setup-java@v3
169+
with:
170+
java-version: "11"
171+
distribution: "adopt"
172+
- name: Install Global Dependencies
173+
run: yarn global add react-native-cli @sentry/cli yalc
174+
- uses: actions/cache@v3
175+
id: deps-cache
176+
with:
177+
path: |
178+
node_modules
179+
test/perf/TestAppSentry/node_modules
180+
key: ${{ github.workflow }}-${{ github.job }}-${{ hashFiles('yarn.lock', 'test/perf/TestAppSentry/yarn.lock') }}
181+
- name: Install Dependencies
182+
if: steps.deps-cache.outputs['cache-hit'] != 'true'
183+
run: yarn install
184+
- name: Build SDK
185+
run: yarn build
186+
- name: Package SDK
187+
run: yalc publish
188+
- uses: actions/setup-node@v3
189+
with:
190+
node-version: "16"
191+
- uses: actions/cache@v3
192+
id: app-plain-cache
193+
with:
194+
path: ${{ matrix.appPlain }}
195+
# if the whole plain app folder is hashed the cache is never hit as there are files generated in the folder
196+
# the cache key is calculated both at cache retrieval and save time
197+
# hashFiles fails when there are rn android new arch generated files in the folder (exact reason unknown)
198+
key: ${{ github.workflow }}-${{ github.job }}-appplain-${{ matrix.platform }}-${{ matrix.rn-architecture }}-${{ hashFiles('test/perf/TestAppPlain/yarn.lock') }}
199+
- name: Build app plain
200+
if: steps.app-plain-cache.outputs['cache-hit'] != 'true'
201+
working-directory: ./test/perf/TestAppPlain
202+
run: |
203+
yarn install
204+
cd ${{ matrix.platform }}
205+
if [[ "${{ matrix.platform }}" == "android" ]]; then
206+
if [[ ${{ matrix.rn-architecture }} == 'new' ]]; then
207+
perl -i -pe's/newArchEnabled=false/newArchEnabled=true/g' gradle.properties
208+
fi
209+
./gradlew assembleRelease
210+
else
211+
export PRODUCTION=1
212+
if [[ ${{ matrix.rn-architecture }} == 'new' ]]; then
213+
export RCT_NEW_ARCH_ENABLED=1
214+
fi
215+
pod install
216+
cd ../..
217+
fastlane build_perf_test_app_plain
218+
fi
219+
env:
220+
APP_STORE_CONNECT_KEY_ID: ${{ secrets.APP_STORE_CONNECT_KEY_ID }}
221+
APP_STORE_CONNECT_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }}
222+
APP_STORE_CONNECT_KEY: ${{ secrets.APP_STORE_CONNECT_KEY }}
223+
FASTLANE_KEYCHAIN_PASSWORD: ${{ secrets.FASTLANE_KEYCHAIN_PASSWORD }}
224+
MATCH_GIT_PRIVATE_KEY: ${{ secrets.MATCH_GIT_PRIVATE_KEY }}
225+
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
226+
MATCH_USERNAME: ${{ secrets.MATCH_USERNAME }}
227+
- name: Build app with Sentry
228+
working-directory: ./test/perf/TestAppSentry
229+
run: |
230+
yalc add @sentry/react-native
231+
yarn install
232+
cd ${{ matrix.platform }}
233+
if [[ "${{ matrix.platform }}" == "android" ]]; then
234+
if [[ ${{ matrix.rn-architecture }} == 'new' ]]; then
235+
perl -i -pe's/newArchEnabled=false/newArchEnabled=true/g' gradle.properties
236+
fi
237+
./gradlew assembleRelease
238+
else
239+
export PRODUCTION=1
240+
if [[ ${{ matrix.rn-architecture }} == 'new' ]]; then
241+
export RCT_NEW_ARCH_ENABLED=1
242+
fi
243+
pod install
244+
cd ../..
245+
fastlane build_perf_test_app_sentry
246+
cd TestAppSentry
247+
fi
248+
# Remove after build so that the cache isn't invaldiated due to the changes in yarn.lock.
249+
yarn remove @sentry/react-native
250+
env:
251+
APP_STORE_CONNECT_KEY_ID: ${{ secrets.APP_STORE_CONNECT_KEY_ID }}
252+
APP_STORE_CONNECT_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }}
253+
APP_STORE_CONNECT_KEY: ${{ secrets.APP_STORE_CONNECT_KEY }}
254+
FASTLANE_KEYCHAIN_PASSWORD: ${{ secrets.FASTLANE_KEYCHAIN_PASSWORD }}
255+
MATCH_GIT_PRIVATE_KEY: ${{ secrets.MATCH_GIT_PRIVATE_KEY }}
256+
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
257+
MATCH_USERNAME: ${{ secrets.MATCH_USERNAME }}
258+
- name: Collect apps metrics
259+
uses: getsentry/action-app-sdk-overhead-metrics@v1
260+
with:
261+
name: ${{ matrix.name }} (${{ matrix.rn-architecture }})
262+
config: ./test/perf/metrics-${{ matrix.platform }}.yml
263+
sauce-user: ${{ secrets.SAUCE_USERNAME }}
264+
sauce-key: ${{ secrets.SAUCE_ACCESS_KEY }}

.github/workflows/release.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,14 @@ on:
88
force:
99
description: Force a release even when there are release-blockers (optional)
1010
required: false
11+
merge_target:
12+
description: Target branch to merge into. Uses the default branch as a fallback (optional)
13+
required: false
1114

1215
jobs:
1316
job_release:
1417
runs-on: ubuntu-latest
15-
name: 'Release a new version'
18+
name: "Release a new version"
1619
steps:
1720
- name: Check out current commit (${{ github.sha }})
1821
uses: actions/checkout@v3
@@ -28,3 +31,4 @@ jobs:
2831
with:
2932
version: ${{ github.event.inputs.version }}
3033
force: ${{ github.event.inputs.force }}
34+
merge_target: ${{ github.event.inputs.merge_target }}

.npmignore

+1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@
1010
!react-native.config.js
1111
!/ios/**/*
1212
!/android/**/*
13+
!src/js/NativeRNSentry.ts
1314
!scripts/collect-modules.sh

0 commit comments

Comments
 (0)