feat(metrics): Add implementation for metrics envelope item #379
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: SDK Size Analysis | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| types: [opened, synchronize, reopened, labeled] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| jobs: | |
| ready-to-merge-gate: | |
| name: Ready-to-merge gate | |
| uses: ./.github/workflows/ready-to-merge-workflow.yml | |
| files-changed: | |
| name: Detect File Changes | |
| runs-on: ubuntu-latest | |
| needs: ready-to-merge-gate | |
| outputs: | |
| run_size_analysis_for_prs: ${{ steps.changes.outputs.run_size_analysis_for_prs }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Get changed files | |
| id: changes | |
| uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 | |
| with: | |
| token: ${{ github.token }} | |
| filters: .github/file-filters.yml | |
| build: | |
| name: Build and Analyze SDK Size | |
| runs-on: macos-26 | |
| if: github.event_name != 'pull_request' || needs.files-changed.outputs.run_size_analysis_for_prs == 'true' | |
| needs: files-changed | |
| timeout-minutes: 20 | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v6 | |
| - name: Select Xcode | |
| run: ./scripts/ci-select-xcode.sh 16.4 | |
| - name: Setup Ruby | |
| uses: ruby/setup-ruby@8aeb6ff8030dd539317f8e1769a044873b56ea71 # v1.268.0 | |
| with: | |
| bundler-cache: true | |
| - run: make init-ci-build | |
| # This needs to be done before xcode-ci because it makes the Sentry framework to be static. | |
| # Or Xcode will try to embed an empty framework. | |
| - name: Make Sentry Static | |
| run: | | |
| echo "MACH_O_TYPE = staticlib" >> Sources/Configuration/Sentry.xcconfig | |
| - run: make xcode-ci | |
| - name: Build and Upload for Size Analysis | |
| run: bundle exec fastlane build_ios_for_size_analysis | |
| env: | |
| FASTLANE_BUNDLE_VERSION: ${{ github.run_number }} | |
| FASTLANE_KEYCHAIN_PASSWORD: ${{ secrets.FASTLANE_KEYCHAIN_PASSWORD }} | |
| MATCH_GIT_PRIVATE_KEY: ${{ secrets.MATCH_GIT_PRIVATE_KEY }} | |
| MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} | |
| MATCH_USERNAME: ${{ secrets.MATCH_USERNAME }} | |
| SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
| - name: Run CI Diagnostics | |
| if: failure() | |
| shell: bash | |
| run: ./scripts/ci-diagnostics.sh | |
| build-required-check: | |
| needs: | |
| [ | |
| ready-to-merge-gate, | |
| files-changed, | |
| build, | |
| ] | |
| name: Size Analysis | |
| # This is necessary since a failed/skipped dependent job would cause this job to be skipped | |
| if: always() | |
| runs-on: ubuntu-latest | |
| steps: | |
| # If any jobs we depend on fails gets cancelled or times out, this job will fail. | |
| # Skipped jobs are not considered failures. | |
| - name: Check for failures | |
| if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') | |
| run: | | |
| echo "One of the size analysis jobs has failed." && exit 1 |