|
5 | 5 | branches: [main]
|
6 | 6 | pull_request:
|
7 | 7 |
|
| 8 | +concurrency: |
| 9 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 10 | + cancel-in-progress: true |
| 11 | + |
8 | 12 | env:
|
9 | 13 | SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
10 | 14 |
|
@@ -140,3 +144,121 @@ jobs:
|
140 | 144 | path: |
|
141 | 145 | ./sample/*.log
|
142 | 146 | ./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 }} |
0 commit comments