fix(tests): Fix flaky SentryCrashInstallationReporterTests #3231
Workflow file for this run
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 }} | |
| is_dependabot: ${{ github.actor == 'dependabot[bot]' }} | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| - name: Get changed files | |
| id: changes | |
| uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 | |
| with: | |
| token: ${{ github.token }} | |
| filters: .github/file-filters.yml | |
| skip-size-analysis-for-non-contributors: | |
| name: Skip Size Analysis for Non-Contributors | |
| runs-on: ubuntu-latest | |
| needs: files-changed | |
| # Skip for non-contributors, but not for dependabot (handled in build) | |
| if: github.event_name == 'pull_request' && needs.files-changed.outputs.run_size_analysis_for_prs == 'true' && !contains(fromJson('["OWNER", "MEMBER", "COLLABORATOR", "CONTRIBUTOR"]'), github.event.pull_request.author_association) && needs.files-changed.outputs.is_dependabot == 'false' | |
| steps: | |
| - name: Skip Size Analysis for Non-Contributors | |
| run: | | |
| echo "Skipping size analysis for non-contributors" | |
| exit 0 | |
| build: | |
| name: Build and Analyze SDK Size | |
| runs-on: macos-26 | |
| # Run for PRs with related changes (including dependabot) or non-PR events. | |
| if: | | |
| github.event_name != 'pull_request' || ( | |
| needs.files-changed.outputs.run_size_analysis_for_prs == 'true' && ( | |
| contains( | |
| fromJson('["OWNER", "MEMBER", "COLLABORATOR", "CONTRIBUTOR"]'), | |
| github.event.pull_request.author_association | |
| ) || | |
| needs.files-changed.outputs.is_dependabot == 'true') | |
| ) | |
| needs: files-changed | |
| timeout-minutes: 20 | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| - name: Select Xcode | |
| run: ./scripts/ci-select-xcode.sh 26.1.1 | |
| - name: Setup Ruby | |
| uses: ruby/setup-ruby@6ca151fd1bfcfd6fe0c4eb6837eb0584d0134a0c # v1.290.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 | |
| # When running the workflows for dependabot PRs, we need to skip code signing, because the code signing secrets are not available for dependabot PRs. | |
| # We still want to run as much of the full workflow as possible, to verify the behaviour. | |
| - name: Build and Upload for Size Analysis | |
| run: | | |
| bundle exec fastlane build_ios_for_size_analysis \ | |
| skip_codesigning:${{ needs.files-changed.outputs.is_dependabot == 'true' }} | |
| 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, | |
| skip-size-analysis-for-non-contributors, | |
| ] | |
| 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 |