-
-
Notifications
You must be signed in to change notification settings - Fork 360
174 lines (146 loc) · 5.43 KB
/
size-analysis.yml
File metadata and controls
174 lines (146 loc) · 5.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
name: Size Analysis
on:
push:
branches:
- main
paths:
- 'packages/**'
- 'samples/react-native/**'
- '.github/workflows/size-analysis.yml'
pull_request:
paths:
- 'packages/**'
- 'samples/react-native/**'
- '.github/workflows/size-analysis.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: sentry-sdks
SENTRY_PROJECT: sentry-react-native
REACT_NATIVE_SAMPLE_PATH: samples/react-native
RN_SENTRY_POD_NAME: RNSentry
jobs:
ready-to-merge-gate:
name: Ready-to-merge gate
uses: ./.github/workflows/ready-to-merge-workflow.yml
with:
is-pr: ${{ github.event_name == 'pull_request' }}
labels: ${{ toJson(github.event.pull_request.labels) }}
android:
needs: [ready-to-merge-gate]
name: Android Size Analysis
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Enable Corepack (NPM)
run: npm i -g corepack
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
with:
package-manager-cache: false
node-version: 22
cache: 'yarn'
cache-dependency-path: yarn.lock
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
with:
java-version: '17'
distribution: 'adopt'
- name: Gradle cache
uses: gradle/gradle-build-action@ac2d340dc04d9e1113182899e983b5400c17cda1 # v3.5.0
- name: Install SDK Dependencies
run: yarn install
- name: Build SDK
run: yarn build
- name: Build Android App Bundle (Release)
working-directory: ${{ env.REACT_NATIVE_SAMPLE_PATH }}/android
env:
SENTRY_DISABLE_AUTO_UPLOAD: 'true'
RN_ARCHITECTURE: 'new'
run: |
perl -i -pe's/newArchEnabled=false/newArchEnabled=true/g' gradle.properties
./gradlew :app:bundleRelease -PreactNativeArchitectures=arm64-v8a
- name: Install Sentry CLI
if: env.SENTRY_AUTH_TOKEN != ''
run: curl -sL https://sentry.io/get-cli/ | sh
- name: Upload Android Bundle to Sentry Size Analysis
if: env.SENTRY_AUTH_TOKEN != ''
run: |
sentry-cli build upload \
"${{ env.REACT_NATIVE_SAMPLE_PATH }}/android/app/build/outputs/bundle/release/app-release.aab" \
--org "${{ env.SENTRY_ORG }}" \
--project "${{ env.SENTRY_PROJECT }}" \
--build-configuration "Release"
ios:
needs: [ready-to-merge-gate]
name: iOS Size Analysis
runs-on: ["ghcr.io/cirruslabs/macos-tahoe-xcode:26.2.0", "runner_group_id:10"]
timeout-minutes: 45
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Enable Corepack
run: corepack enable
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
with:
package-manager-cache: false
node-version: 22
cache: 'yarn'
cache-dependency-path: yarn.lock
- uses: ruby/setup-ruby@v1
with:
working-directory: ${{ env.REACT_NATIVE_SAMPLE_PATH }}
ruby-version: '3.3.0'
bundler-cache: true
cache-version: 1
- name: Setup Global Xcode Tools
run: which xcbeautify || brew install xcbeautify
- name: Install SDK Dependencies
run: yarn install
- name: Build SDK
run: yarn build
- name: Install App Pods
working-directory: ${{ env.REACT_NATIVE_SAMPLE_PATH }}
run: |
export ENABLE_PROD=1
export ENABLE_NEW_ARCH=1
./scripts/pod-install.sh
- name: Build iOS XCArchive
working-directory: ${{ env.REACT_NATIVE_SAMPLE_PATH }}/ios
env:
SENTRY_DISABLE_AUTO_UPLOAD: 'true'
# Fix for Xcode 26+ with MetalToolchain
TOOLCHAINS: com.apple.dt.toolchain.XcodeDefault
run: |
mkdir -p "DerivedData"
derivedData="$(cd "DerivedData" ; pwd -P)"
set -o pipefail && xcodebuild \
-workspace sentryreactnativesample.xcworkspace \
-configuration Release \
-scheme sentryreactnativesample \
-sdk iphoneos \
-destination 'generic/platform=iOS' \
-archivePath "$derivedData/sentryreactnativesample.xcarchive" \
ONLY_ACTIVE_ARCH=NO \
CODE_SIGNING_ALLOWED=NO \
archive \
| tee xcodebuild-size-analysis.log \
| xcbeautify --quieter --is-ci --disable-colored-output
- name: Install Sentry CLI
if: env.SENTRY_AUTH_TOKEN != ''
run: curl -sL https://sentry.io/get-cli/ | sh
- name: Upload iOS XCArchive to Sentry Size Analysis
if: env.SENTRY_AUTH_TOKEN != ''
working-directory: ${{ env.REACT_NATIVE_SAMPLE_PATH }}/ios
run: |
sentry-cli build upload \
"DerivedData/sentryreactnativesample.xcarchive" \
--org "${{ env.SENTRY_ORG }}" \
--project "${{ env.SENTRY_PROJECT }}" \
--build-configuration "Release"
- name: Upload logs
if: ${{ always() }}
uses: actions/upload-artifact@v7
with:
name: size-analysis-ios-logs
path: ${{ env.REACT_NATIVE_SAMPLE_PATH }}/ios/xcodebuild-size-analysis.log