From 4b1e2d1deaeafda477b614ab260302b80c2db6af Mon Sep 17 00:00:00 2001 From: Alexander Pantiukhov Date: Mon, 30 Mar 2026 11:51:22 +0200 Subject: [PATCH 1/2] fix(ci): Avoid unnecessary runner allocation by splitting platform matrix into separate jobs --- .github/workflows/sample-application-expo.yml | 178 ++++++--- .github/workflows/sample-application.yml | 375 +++++++++++------- 2 files changed, 344 insertions(+), 209 deletions(-) diff --git a/.github/workflows/sample-application-expo.yml b/.github/workflows/sample-application-expo.yml index 16c4138ef5..44e261aab2 100644 --- a/.github/workflows/sample-application-expo.yml +++ b/.github/workflows/sample-application-expo.yml @@ -34,53 +34,30 @@ jobs: caller_event_name: ${{ github.event_name }} caller_ref: ${{ github.ref }} - build: - name: Build ${{ matrix.platform }} ${{ matrix.build-type }} ${{ matrix.ios-use-frameworks}} - runs-on: ${{ matrix.runs-on }} + build-ios: + name: Build ios ${{ matrix.build-type }} ${{ matrix.ios-use-frameworks }} + runs-on: ["ghcr.io/cirruslabs/macos-tahoe-xcode:26.2.0", "runner_group_id:10"] needs: [diff_check, detect-changes] - if: ${{ needs.diff_check.outputs.skip_ci != 'true' && needs.detect-changes.outputs.needs_sample_expo == 'true' }} + if: >- + ${{ + needs.diff_check.outputs.skip_ci != 'true' + && needs.detect-changes.outputs.needs_sample_expo == 'true' + && (needs.detect-changes.outputs.sample_expo == 'true' || needs.detect-changes.outputs.needs_ios == 'true') + }} env: SENTRY_DISABLE_AUTO_UPLOAD: 'true' strategy: - # we want that the matrix keeps running, default is to cancel them if it fails. fail-fast: false matrix: ios-use-frameworks: ['no-frameworks', 'dynamic-frameworks'] - platform: ['android', 'ios'] build-type: ['dev', 'production'] - include: - - platform: ios - runs-on: ["ghcr.io/cirruslabs/macos-tahoe-xcode:26.2.0", "runner_group_id:10"] - - platform: android - runs-on: ubuntu-latest - - platform: web - runs-on: ubuntu-latest - exclude: - - platform: 'android' - ios-use-frameworks: 'dynamic-frameworks' steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 - - name: Check if platform is needed - id: platform-check - uses: ./.github/actions/platform-check - with: - platform: ${{ matrix.platform }} - sample_changed: ${{ needs.detect-changes.outputs.sample_expo }} - needs_ios: ${{ needs.detect-changes.outputs.needs_ios }} - needs_android: ${{ needs.detect-changes.outputs.needs_android }} - needs_web: ${{ needs.detect-changes.outputs.needs_web }} - - - name: Enable Corepack (NPM) - if: ${{ steps.platform-check.outputs.skip != 'true' && matrix.platform != 'ios' }} - run: npm i -g corepack - - name: Enable Corepack - if: ${{ steps.platform-check.outputs.skip != 'true' && matrix.platform == 'ios' }} run: corepack enable - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 - if: ${{ steps.platform-check.outputs.skip != 'true' }} with: package-manager-cache: false node-version: 20 @@ -88,7 +65,6 @@ jobs: cache-dependency-path: yarn.lock - uses: ruby/setup-ruby@v1 - if: ${{ steps.platform-check.outputs.skip != 'true' && matrix.platform == 'ios' }} with: working-directory: samples/expo ruby-version: '3.3.0' # based on what is used in the sample @@ -96,34 +72,27 @@ jobs: cache-version: 1 # cache the installed gems - uses: actions/setup-java@v5 - if: ${{ steps.platform-check.outputs.skip != 'true' }} with: java-version: '17' distribution: 'adopt' - name: Gradle cache - if: ${{ steps.platform-check.outputs.skip != 'true' }} uses: gradle/gradle-build-action@ac2d340dc04d9e1113182899e983b5400c17cda1 # v3.5.0 - name: Setup Global Xcode Tools - if: ${{ steps.platform-check.outputs.skip != 'true' && matrix.platform == 'ios' }} run: which xcbeautify || brew install xcbeautify - name: Install SDK Dependencies - if: ${{ steps.platform-check.outputs.skip != 'true' }} run: yarn install - name: Build SDK - if: ${{ steps.platform-check.outputs.skip != 'true' }} run: yarn build - name: Prebuild apps - if: ${{ steps.platform-check.outputs.skip != 'true' && (matrix.platform == 'android' || matrix.platform == 'ios') }} working-directory: samples/expo run: npx expo prebuild - name: Install App Pods - if: ${{ steps.platform-check.outputs.skip != 'true' && matrix.platform == 'ios' }} working-directory: samples/expo/ios run: | [[ "${{ matrix.build-type }}" == "production" ]] && ENABLE_PROD=1 || ENABLE_PROD=0 @@ -134,19 +103,7 @@ jobs: PRODUCTION=$ENABLE_PROD pod install cat Podfile.lock | grep $RN_SENTRY_POD_NAME - - name: Build Android App - if: ${{ steps.platform-check.outputs.skip != 'true' && matrix.platform == 'android' }} - working-directory: samples/expo/android - env: - # Increase memory for Expo SDK 55 lint tasks - GRADLE_OPTS: "-Dorg.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=1g" - run: | - [[ "${{ matrix.build-type }}" == "production" ]] && CONFIG='Release' || CONFIG='Debug' - echo "Building $CONFIG" - ./gradlew ":app:assemble$CONFIG" -PreactNativeArchitectures=x86 - - name: Build iOS App - if: ${{ steps.platform-check.outputs.skip != 'true' && matrix.platform == 'ios' }} working-directory: samples/expo/ios env: # Fix for Xcode 26+ with MetalToolchain: use default Xcode toolchain to avoid @@ -171,21 +128,124 @@ jobs: | tee xcodebuild.log \ | xcbeautify --quieter --is-ci --disable-colored-output - - name: Build Web App - if: ${{ steps.platform-check.outputs.skip != 'true' && matrix.platform == 'web' }} + - name: Export Expo working-directory: samples/expo run: | - npx expo export -p web + npx expo export + + - name: Upload logs + if: ${{ always() }} + uses: actions/upload-artifact@v7 + with: + name: build-sample-expo-ios-${{ matrix.build-type }}-${{ matrix.ios-use-frameworks}}-logs + path: samples/expo/ios/*.log + + build-android: + name: Build android ${{ matrix.build-type }} + runs-on: ubuntu-latest + needs: [diff_check, detect-changes] + if: >- + ${{ + needs.diff_check.outputs.skip_ci != 'true' + && needs.detect-changes.outputs.needs_sample_expo == 'true' + && (needs.detect-changes.outputs.sample_expo == 'true' || needs.detect-changes.outputs.needs_android == 'true') + }} + env: + SENTRY_DISABLE_AUTO_UPLOAD: 'true' + strategy: + fail-fast: false + matrix: + build-type: ['dev', 'production'] + 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: 20 + cache: 'yarn' + cache-dependency-path: yarn.lock + + - uses: actions/setup-java@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: Prebuild apps + working-directory: samples/expo + run: npx expo prebuild + + - name: Build Android App + working-directory: samples/expo/android + env: + # Increase memory for Expo SDK 55 lint tasks + GRADLE_OPTS: "-Dorg.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=1g" + run: | + [[ "${{ matrix.build-type }}" == "production" ]] && CONFIG='Release' || CONFIG='Debug' + echo "Building $CONFIG" + ./gradlew ":app:assemble$CONFIG" -PreactNativeArchitectures=x86 - name: Export Expo - if: ${{ steps.platform-check.outputs.skip != 'true' }} working-directory: samples/expo run: | npx expo export - name: Upload logs - if: ${{ always() && steps.platform-check.outputs.skip != 'true' }} + if: ${{ always() }} uses: actions/upload-artifact@v7 with: - name: build-sample-expo-${{ matrix.platform }}-${{ matrix.build-type }}-${{ matrix.ios-use-frameworks}}-logs - path: samples/expo/${{ matrix.platform }}/*.log + name: build-sample-expo-android-${{ matrix.build-type }}-logs + path: samples/expo/android/*.log + + build-web: + name: Build web + runs-on: ubuntu-latest + needs: [diff_check, detect-changes] + if: >- + ${{ + needs.diff_check.outputs.skip_ci != 'true' + && needs.detect-changes.outputs.needs_sample_expo == 'true' + && (needs.detect-changes.outputs.sample_expo == 'true' || needs.detect-changes.outputs.needs_web == 'true') + }} + env: + SENTRY_DISABLE_AUTO_UPLOAD: 'true' + 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: 20 + cache: 'yarn' + cache-dependency-path: yarn.lock + + - name: Install SDK Dependencies + run: yarn install + + - name: Build SDK + run: yarn build + + - name: Build Web App + working-directory: samples/expo + run: | + npx expo export -p web + + - name: Export Expo + working-directory: samples/expo + run: | + npx expo export diff --git a/.github/workflows/sample-application.yml b/.github/workflows/sample-application.yml index 61653c65aa..4f04e926dd 100644 --- a/.github/workflows/sample-application.yml +++ b/.github/workflows/sample-application.yml @@ -42,59 +42,34 @@ jobs: caller_event_name: ${{ github.event_name }} caller_ref: ${{ github.ref }} - build: - name: Build ${{ matrix.rn-architecture }} ${{ matrix.platform }} ${{ matrix.build-type }} ${{ matrix.ios-use-frameworks}} - runs-on: ${{ matrix.runs-on }} + build-ios: + name: Build ${{ matrix.rn-architecture }} ios ${{ matrix.build-type }} ${{ matrix.ios-use-frameworks }} + runs-on: ["ghcr.io/cirruslabs/macos-tahoe-xcode:26.2.0", "runner_group_id:10"] needs: [diff_check, detect-changes] - if: ${{ needs.diff_check.outputs.skip_ci != 'true' && needs.detect-changes.outputs.needs_sample_react_native == 'true' }} + if: >- + ${{ + needs.diff_check.outputs.skip_ci != 'true' + && needs.detect-changes.outputs.needs_sample_react_native == 'true' + && (needs.detect-changes.outputs.sample_react_native == 'true' || needs.detect-changes.outputs.needs_ios == 'true') + }} env: SENTRY_DISABLE_AUTO_UPLOAD: 'true' strategy: - # we want that the matrix keeps running, default is to cancel them if it fails. fail-fast: false matrix: rn-architecture: ['legacy', 'new'] ios-use-frameworks: ['no-frameworks', 'dynamic-frameworks'] - platform: ['android', 'ios', 'macos'] build-type: ['dev', 'production'] - include: - - platform: ios - runs-on: ["ghcr.io/cirruslabs/macos-tahoe-xcode:26.2.0", "runner_group_id:10"] - - platform: macos - runs-on: ["ghcr.io/cirruslabs/macos-sequoia-xcode:16.4", "runner_group_id:10"] - - platform: android - runs-on: ubuntu-latest exclude: - - platform: 'android' - ios-use-frameworks: 'dynamic-frameworks' - rn-architecture: 'new' ios-use-frameworks: 'dynamic-frameworks' - - rn-architecture: 'new' - platform: 'macos' - - ios-use-frameworks: 'dynamic-frameworks' - platform: 'macos' steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 - - name: Check if platform is needed - id: platform-check - uses: ./.github/actions/platform-check - with: - platform: ${{ matrix.platform }} - sample_changed: ${{ needs.detect-changes.outputs.sample_react_native }} - needs_ios: ${{ needs.detect-changes.outputs.needs_ios }} - needs_android: ${{ needs.detect-changes.outputs.needs_android }} - - - name: Enable Corepack (NPM) - if: ${{ steps.platform-check.outputs.skip != 'true' && matrix.platform == 'android' }} - run: npm i -g corepack - - name: Enable Corepack - if: ${{ steps.platform-check.outputs.skip != 'true' && matrix.platform != 'android' }} run: corepack enable - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 - if: ${{ steps.platform-check.outputs.skip != 'true' }} with: package-manager-cache: false node-version: 18 @@ -102,60 +77,39 @@ jobs: cache-dependency-path: yarn.lock - uses: ruby/setup-ruby@v1 - if: ${{ steps.platform-check.outputs.skip != 'true' && (matrix.platform == 'ios' || matrix.platform == 'macos') }} with: - working-directory: ${{ matrix.platform == 'ios' && env.REACT_NATIVE_SAMPLE_PATH || 'samples/react-native-macos' }} + working-directory: ${{ env.REACT_NATIVE_SAMPLE_PATH }} ruby-version: '3.3.0' # based on what is used in the sample bundler-cache: true # runs 'bundle install' and caches installed gems automatically cache-version: 1 # cache the installed gems - uses: actions/setup-java@v5 - if: ${{ steps.platform-check.outputs.skip != 'true' }} with: java-version: '17' distribution: 'adopt' - name: Gradle cache - if: ${{ steps.platform-check.outputs.skip != 'true' }} uses: gradle/gradle-build-action@v3 - name: Setup Global Xcode Tools - if: ${{ steps.platform-check.outputs.skip != 'true' && (matrix.platform == 'ios' || matrix.platform == 'macos') }} run: which xcbeautify || brew install xcbeautify - name: Install SDK Dependencies - if: ${{ steps.platform-check.outputs.skip != 'true' }} run: yarn install - name: Build SDK - if: ${{ steps.platform-check.outputs.skip != 'true' }} run: yarn build - name: Install App Pods - if: ${{ steps.platform-check.outputs.skip != 'true' && (matrix.platform == 'ios' || matrix.platform == 'macos') }} - working-directory: samples + working-directory: ${{ env.REACT_NATIVE_SAMPLE_PATH }} run: | - [[ "${{ matrix.platform }}" == "ios" ]] && cd react-native - [[ "${{ matrix.platform }}" == "macos" ]] && cd react-native-macos - [[ "${{ 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 ./scripts/pod-install.sh - - name: Build Android App - if: ${{ steps.platform-check.outputs.skip != 'true' && matrix.platform == 'android' }} - working-directory: ${{ env.REACT_NATIVE_SAMPLE_PATH }} - run: | - export RN_ARCHITECTURE="${{ matrix.rn-architecture }}" - [[ "${{ matrix.build-type }}" == "production" ]] && export CONFIG='release' || export CONFIG='debug' - - ./scripts/set-dsn-aos.mjs - ./scripts/build-android.sh -PreactNativeArchitectures=x86 - - name: Build iOS App - if: ${{ steps.platform-check.outputs.skip != 'true' && matrix.platform == 'ios' }} working-directory: ${{ env.REACT_NATIVE_SAMPLE_PATH }} env: # Fix for Xcode 26+ with MetalToolchain: use default Xcode toolchain to avoid @@ -168,139 +122,276 @@ jobs: ./scripts/set-dsn-ios.mjs ./scripts/build-ios.sh - - name: Build macOS App - if: ${{ steps.platform-check.outputs.skip != 'true' && matrix.platform == 'macos' }} - working-directory: samples/react-native-macos/macos - run: | - [[ "${{ matrix.build-type }}" == "production" ]] && export CONFIG='Release' || export CONFIG='Debug' - echo "Building $CONFIG" - mkdir -p "DerivedData" - derivedData="$(cd "DerivedData" ; pwd -P)" - set -o pipefail && xcodebuild \ - -workspace sentry-react-native-sample.xcworkspace \ - -configuration "$CONFIG" \ - -scheme sentry-react-native-sample-macOS \ - -destination 'platform=macOS' \ - ONLY_ACTIVE_ARCH=yes \ - -derivedDataPath "$derivedData" \ - build \ - | tee xcodebuild.log \ - | xcbeautify --quieter --is-ci --disable-colored-output - - name: Archive iOS App - if: ${{ steps.platform-check.outputs.skip != 'true' && matrix.platform == 'ios' && matrix.rn-architecture == 'new' && matrix.build-type == 'production' && matrix.ios-use-frameworks == 'no-frameworks' }} + if: ${{ matrix.rn-architecture == 'new' && matrix.build-type == 'production' && matrix.ios-use-frameworks == 'no-frameworks' }} working-directory: ${{ env.REACT_NATIVE_SAMPLE_PATH }} run: | zip -r \ ${{ github.workspace }}/${{ env.IOS_APP_ARCHIVE_PATH }} \ sentryreactnativesample.app + - name: Upload iOS APP + if: ${{ matrix.rn-architecture == 'new' && matrix.build-type == 'production' && matrix.ios-use-frameworks == 'no-frameworks' }} + uses: actions/upload-artifact@v7 + with: + name: sample-rn-${{ matrix.rn-architecture }}-${{ matrix.build-type }}-${{ matrix.ios-use-frameworks}}-ios + path: ${{ env.IOS_APP_ARCHIVE_PATH }} + retention-days: 1 + + - name: Upload logs + if: ${{ always() }} + uses: actions/upload-artifact@v7 + with: + name: build-sample-${{ matrix.rn-architecture }}-ios-${{ matrix.build-type }}-${{ matrix.ios-use-frameworks}}-logs + path: ${{ env.REACT_NATIVE_SAMPLE_PATH }}/ios/*.log + + build-android: + name: Build ${{ matrix.rn-architecture }} android ${{ matrix.build-type }} + runs-on: ubuntu-latest + needs: [diff_check, detect-changes] + if: >- + ${{ + needs.diff_check.outputs.skip_ci != 'true' + && needs.detect-changes.outputs.needs_sample_react_native == 'true' + && (needs.detect-changes.outputs.sample_react_native == 'true' || needs.detect-changes.outputs.needs_android == 'true') + }} + env: + SENTRY_DISABLE_AUTO_UPLOAD: 'true' + strategy: + fail-fast: false + matrix: + rn-architecture: ['legacy', 'new'] + build-type: ['dev', 'production'] + 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: 18 + cache: 'yarn' + cache-dependency-path: yarn.lock + + - uses: actions/setup-java@v5 + with: + java-version: '17' + distribution: 'adopt' + + - name: Gradle cache + uses: gradle/gradle-build-action@v3 + + - name: Install SDK Dependencies + run: yarn install + + - name: Build SDK + run: yarn build + + - name: Build Android App + working-directory: ${{ env.REACT_NATIVE_SAMPLE_PATH }} + run: | + export RN_ARCHITECTURE="${{ matrix.rn-architecture }}" + [[ "${{ matrix.build-type }}" == "production" ]] && export CONFIG='release' || export CONFIG='debug' + + ./scripts/set-dsn-aos.mjs + ./scripts/build-android.sh -PreactNativeArchitectures=x86 + - name: Archive Android App - if: ${{ steps.platform-check.outputs.skip != 'true' && matrix.platform == 'android' && matrix.rn-architecture == 'new' && matrix.build-type == 'production' }} + if: ${{ matrix.rn-architecture == 'new' && matrix.build-type == 'production' }} run: | zip -j \ ${{ env.ANDROID_APP_ARCHIVE_PATH }} \ ${{ env.REACT_NATIVE_SAMPLE_PATH }}/app.apk \ ${{ env.REACT_NATIVE_SAMPLE_PATH }}/app-androidTest.apk - - name: Upload iOS APP - if: ${{ steps.platform-check.outputs.skip != 'true' && matrix.platform == 'ios' && matrix.rn-architecture == 'new' && matrix.build-type == 'production' && matrix.ios-use-frameworks == 'no-frameworks' }} - uses: actions/upload-artifact@v7 - with: - name: sample-rn-${{ matrix.rn-architecture }}-${{ matrix.build-type }}-${{ matrix.ios-use-frameworks}}-${{ matrix.platform }} - path: ${{ env.IOS_APP_ARCHIVE_PATH }} - retention-days: 1 - - name: Upload Android APK - if: ${{ steps.platform-check.outputs.skip != 'true' && matrix.platform == 'android' && matrix.rn-architecture == 'new' && matrix.build-type == 'production' }} + if: ${{ matrix.rn-architecture == 'new' && matrix.build-type == 'production' }} uses: actions/upload-artifact@v7 with: - name: sample-rn-${{ matrix.rn-architecture }}-${{ matrix.build-type }}-${{ matrix.platform }} + name: sample-rn-${{ matrix.rn-architecture }}-${{ matrix.build-type }}-android path: ${{ env.ANDROID_APP_ARCHIVE_PATH }} retention-days: 1 - name: Upload logs - if: ${{ always() && steps.platform-check.outputs.skip != 'true' }} + if: ${{ always() }} uses: actions/upload-artifact@v7 with: - name: build-sample-${{ matrix.rn-architecture }}-${{ matrix.platform }}-${{ matrix.build-type }}-${{ matrix.ios-use-frameworks}}-logs - path: ${{ env.REACT_NATIVE_SAMPLE_PATH }}/${{ matrix.platform }}/*.log - - test: - name: Test ${{ matrix.platform }} ${{ matrix.build-type }} REV2 - runs-on: ${{ matrix.runs-on }} - needs: [diff_check, detect-changes, build] - if: ${{ needs.diff_check.outputs.skip_ci != 'true' && needs.detect-changes.outputs.needs_sample_react_native == 'true' }} + name: build-sample-${{ matrix.rn-architecture }}-android-${{ matrix.build-type }}-no-frameworks-logs + path: ${{ env.REACT_NATIVE_SAMPLE_PATH }}/android/*.log + + build-macos: + name: Build legacy macos ${{ matrix.build-type }} + runs-on: ["ghcr.io/cirruslabs/macos-sequoia-xcode:16.4", "runner_group_id:10"] + needs: [diff_check, detect-changes] + if: >- + ${{ + needs.diff_check.outputs.skip_ci != 'true' + && needs.detect-changes.outputs.needs_sample_react_native == 'true' + && (needs.detect-changes.outputs.sample_react_native == 'true' || needs.detect-changes.outputs.needs_ios == 'true') + }} + env: + SENTRY_DISABLE_AUTO_UPLOAD: 'true' strategy: - # we want that the matrix keeps running, default is to cancel them if it fails. fail-fast: false matrix: - include: - - platform: ios - runs-on: ["ghcr.io/cirruslabs/macos-tahoe-xcode:26.2.0", "runner_group_id:10"] - rn-architecture: 'new' - ios-use-frameworks: 'no-frameworks' - build-type: 'production' - - - platform: android - runs-on: ubuntu-latest - rn-architecture: 'new' - build-type: 'production' - + build-type: ['dev', 'production'] steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 - - name: Check if platform is needed - id: platform-check - uses: ./.github/actions/platform-check + - name: Enable Corepack + run: corepack enable + + - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 + with: + package-manager-cache: false + node-version: 18 + cache: 'yarn' + cache-dependency-path: yarn.lock + + - uses: ruby/setup-ruby@v1 + with: + working-directory: samples/react-native-macos + ruby-version: '3.3.0' # based on what is used in the sample + bundler-cache: true # runs 'bundle install' and caches installed gems automatically + cache-version: 1 # cache the installed gems + + - uses: actions/setup-java@v5 + with: + java-version: '17' + distribution: 'adopt' + + - name: Gradle cache + uses: gradle/gradle-build-action@v3 + + - 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: samples/react-native-macos + run: | + [[ "${{ matrix.build-type }}" == "production" ]] && export ENABLE_PROD=1 || export ENABLE_PROD=0 + export ENABLE_NEW_ARCH=0 + + ./scripts/pod-install.sh + + - name: Build macOS App + working-directory: samples/react-native-macos/macos + run: | + [[ "${{ matrix.build-type }}" == "production" ]] && export CONFIG='Release' || export CONFIG='Debug' + echo "Building $CONFIG" + mkdir -p "DerivedData" + derivedData="$(cd "DerivedData" ; pwd -P)" + set -o pipefail && xcodebuild \ + -workspace sentry-react-native-sample.xcworkspace \ + -configuration "$CONFIG" \ + -scheme sentry-react-native-sample-macOS \ + -destination 'platform=macOS' \ + ONLY_ACTIVE_ARCH=yes \ + -derivedDataPath "$derivedData" \ + build \ + | tee xcodebuild.log \ + | xcbeautify --quieter --is-ci --disable-colored-output + + - name: Upload logs + if: ${{ always() }} + uses: actions/upload-artifact@v7 with: - platform: ${{ matrix.platform }} - sample_changed: ${{ needs.detect-changes.outputs.sample_react_native }} - needs_ios: ${{ needs.detect-changes.outputs.needs_ios }} - needs_android: ${{ needs.detect-changes.outputs.needs_android }} + name: build-sample-legacy-macos-${{ matrix.build-type }}-no-frameworks-logs + path: ${{ env.REACT_NATIVE_SAMPLE_PATH }}/macos/*.log + + test-ios: + name: Test ios production REV2 + runs-on: ["ghcr.io/cirruslabs/macos-tahoe-xcode:26.2.0", "runner_group_id:10"] + needs: [diff_check, detect-changes, build-ios] + if: >- + ${{ + needs.diff_check.outputs.skip_ci != 'true' + && needs.detect-changes.outputs.needs_sample_react_native == 'true' + && (needs.detect-changes.outputs.sample_react_native == 'true' || needs.detect-changes.outputs.needs_ios == 'true') + }} + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 - name: Install Maestro - if: ${{ steps.platform-check.outputs.skip != 'true' }} uses: dniHze/maestro-test-action@bda8a93211c86d0a05b7a4597c5ad134566fbde4 # pin@v1.0.0 with: version: ${{env.MAESTRO_VERSION}} - name: Download iOS App Archive - if: ${{ steps.platform-check.outputs.skip != 'true' && matrix.platform == 'ios' }} uses: actions/download-artifact@v8 with: - name: sample-rn-${{ matrix.rn-architecture }}-${{ matrix.build-type }}-${{ matrix.ios-use-frameworks}}-${{ matrix.platform }} + name: sample-rn-new-production-no-frameworks-ios path: ${{ env.REACT_NATIVE_SAMPLE_PATH }} + - name: Unzip iOS App Archive + working-directory: ${{ env.REACT_NATIVE_SAMPLE_PATH }} + run: unzip ${{ env.IOS_APP_ARCHIVE_PATH }} + + - name: Enable Corepack + run: corepack enable + + - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 + with: + package-manager-cache: false + node-version: 18 + cache: 'yarn' + cache-dependency-path: yarn.lock + + - name: Install JS Dependencies + run: yarn install + + - name: Boot ${{ env.IOS_DEVICE }} with iOS ${{ env.IOS_VERSION }} + uses: futureware-tech/simulator-action@e89aa8f93d3aec35083ff49d2854d07f7186f7f5 # pin@v5 + with: + model: ${{ env.IOS_DEVICE }} + os_version: ${{ env.IOS_VERSION }} + + - name: Run iOS Tests + working-directory: ${{ env.REACT_NATIVE_SAMPLE_PATH }} + run: yarn test-ios + + test-android: + name: Test android production REV2 + runs-on: ubuntu-latest + needs: [diff_check, detect-changes, build-android] + if: >- + ${{ + needs.diff_check.outputs.skip_ci != 'true' + && needs.detect-changes.outputs.needs_sample_react_native == 'true' + && (needs.detect-changes.outputs.sample_react_native == 'true' || needs.detect-changes.outputs.needs_android == 'true') + }} + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + + - name: Install Maestro + uses: dniHze/maestro-test-action@bda8a93211c86d0a05b7a4597c5ad134566fbde4 # pin@v1.0.0 + with: + version: ${{env.MAESTRO_VERSION}} + - name: Download Android APK - if: ${{ steps.platform-check.outputs.skip != 'true' && matrix.platform == 'android' }} uses: actions/download-artifact@v8 with: - name: sample-rn-${{ matrix.rn-architecture }}-${{ matrix.build-type }}-${{ matrix.platform }} + name: sample-rn-new-production-android path: ${{ env.REACT_NATIVE_SAMPLE_PATH }} - - name: Unzip iOS App Archive - if: ${{ steps.platform-check.outputs.skip != 'true' && matrix.platform == 'ios' }} - working-directory: ${{ env.REACT_NATIVE_SAMPLE_PATH }} - run: unzip ${{ env.IOS_APP_ARCHIVE_PATH }} - - name: Unzip Android APK - if: ${{ steps.platform-check.outputs.skip != 'true' && matrix.platform == 'android' }} working-directory: ${{ env.REACT_NATIVE_SAMPLE_PATH }} run: | unzip ${{ env.ANDROID_APP_ARCHIVE_PATH }} rm app-androidTest.apk - name: Enable Corepack (NPM) - if: ${{ steps.platform-check.outputs.skip != 'true' && matrix.platform == 'android' }} run: npm i -g corepack - - name: Enable Corepack - if: ${{ steps.platform-check.outputs.skip != 'true' && matrix.platform != 'android' }} - run: corepack enable - - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 - if: ${{ steps.platform-check.outputs.skip != 'true' }} with: package-manager-cache: false node-version: 18 @@ -308,14 +399,11 @@ jobs: cache-dependency-path: yarn.lock - name: Install JS Dependencies - if: ${{ steps.platform-check.outputs.skip != 'true' }} run: yarn install - uses: ./.github/actions/disk-cleanup - if: ${{ steps.platform-check.outputs.skip != 'true' && matrix.platform == 'android' }} - name: Setup KVM - if: ${{ steps.platform-check.outputs.skip != 'true' && matrix.platform == 'android' }} shell: bash run: | # check if virtualization is supported... @@ -326,20 +414,7 @@ jobs: sudo udevadm control --reload-rules sudo udevadm trigger --name-match=kvm - - name: Boot ${{ env.IOS_DEVICE }} with iOS ${{ env.IOS_VERSION }} - uses: futureware-tech/simulator-action@e89aa8f93d3aec35083ff49d2854d07f7186f7f5 # pin@v5 - if: ${{ steps.platform-check.outputs.skip != 'true' && matrix.platform == 'ios' }} - with: - model: ${{ env.IOS_DEVICE }} - os_version: ${{ env.IOS_VERSION }} - - - name: Run iOS Tests - if: ${{ steps.platform-check.outputs.skip != 'true' && matrix.platform == 'ios' }} - working-directory: ${{ env.REACT_NATIVE_SAMPLE_PATH }} - run: yarn test-ios - - name: Run Android Tests on API ${{ env.ANDROID_API_LEVEL }} - if: ${{ steps.platform-check.outputs.skip != 'true' && matrix.platform == 'android' }} uses: reactivecircus/android-emulator-runner@e89f39f1abbbd05b1113a29cf4db69e7540cae5a # pin@v2.37.0 with: api-level: ${{ env.ANDROID_API_LEVEL }} From 99c572912ce8ff9e2365642705d13e7f00a63169 Mon Sep 17 00:00:00 2001 From: Alexander Pantiukhov Date: Tue, 31 Mar 2026 09:37:06 +0200 Subject: [PATCH 2/2] Fixes --- .github/workflows/sample-application-expo.yml | 21 ++++--------------- .github/workflows/sample-application.yml | 20 ++---------------- 2 files changed, 6 insertions(+), 35 deletions(-) diff --git a/.github/workflows/sample-application-expo.yml b/.github/workflows/sample-application-expo.yml index 44e261aab2..016fa4aea8 100644 --- a/.github/workflows/sample-application-expo.yml +++ b/.github/workflows/sample-application-expo.yml @@ -71,14 +71,6 @@ jobs: bundler-cache: true # runs 'bundle install' and caches installed gems automatically cache-version: 1 # cache the installed gems - - uses: actions/setup-java@v5 - with: - java-version: '17' - distribution: 'adopt' - - - name: Gradle cache - uses: gradle/gradle-build-action@ac2d340dc04d9e1113182899e983b5400c17cda1 # v3.5.0 - - name: Setup Global Xcode Tools run: which xcbeautify || brew install xcbeautify @@ -90,7 +82,7 @@ jobs: - name: Prebuild apps working-directory: samples/expo - run: npx expo prebuild + run: npx expo prebuild --platform ios - name: Install App Pods working-directory: samples/expo/ios @@ -131,7 +123,7 @@ jobs: - name: Export Expo working-directory: samples/expo run: | - npx expo export + npx expo export -p ios - name: Upload logs if: ${{ always() }} @@ -185,7 +177,7 @@ jobs: - name: Prebuild apps working-directory: samples/expo - run: npx expo prebuild + run: npx expo prebuild --platform android - name: Build Android App working-directory: samples/expo/android @@ -200,7 +192,7 @@ jobs: - name: Export Expo working-directory: samples/expo run: | - npx expo export + npx expo export -p android - name: Upload logs if: ${{ always() }} @@ -244,8 +236,3 @@ jobs: working-directory: samples/expo run: | npx expo export -p web - - - name: Export Expo - working-directory: samples/expo - run: | - npx expo export diff --git a/.github/workflows/sample-application.yml b/.github/workflows/sample-application.yml index 4f04e926dd..02eccd82cb 100644 --- a/.github/workflows/sample-application.yml +++ b/.github/workflows/sample-application.yml @@ -83,14 +83,6 @@ jobs: bundler-cache: true # runs 'bundle install' and caches installed gems automatically cache-version: 1 # cache the installed gems - - uses: actions/setup-java@v5 - with: - java-version: '17' - distribution: 'adopt' - - - name: Gradle cache - uses: gradle/gradle-build-action@v3 - - name: Setup Global Xcode Tools run: which xcbeautify || brew install xcbeautify @@ -181,7 +173,7 @@ jobs: distribution: 'adopt' - name: Gradle cache - uses: gradle/gradle-build-action@v3 + uses: gradle/gradle-build-action@ac2d340dc04d9e1113182899e983b5400c17cda1 # v3.5.0 - name: Install SDK Dependencies run: yarn install @@ -257,14 +249,6 @@ jobs: bundler-cache: true # runs 'bundle install' and caches installed gems automatically cache-version: 1 # cache the installed gems - - uses: actions/setup-java@v5 - with: - java-version: '17' - distribution: 'adopt' - - - name: Gradle cache - uses: gradle/gradle-build-action@v3 - - name: Setup Global Xcode Tools run: which xcbeautify || brew install xcbeautify @@ -305,7 +289,7 @@ jobs: uses: actions/upload-artifact@v7 with: name: build-sample-legacy-macos-${{ matrix.build-type }}-no-frameworks-logs - path: ${{ env.REACT_NATIVE_SAMPLE_PATH }}/macos/*.log + path: samples/react-native-macos/macos/*.log test-ios: name: Test ios production REV2