performance.yml 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. # Merge the yml file to main branch for the cron job schedule to be effective.
  2. # Reference: https://github.community/t/on-schedule-per-branch/17525
  3. name: performance
  4. permissions:
  5. contents: read
  6. on:
  7. workflow_dispatch:
  8. pull_request:
  9. paths:
  10. # Performance sources
  11. - 'FirebasePerformance/**'
  12. # Podspec
  13. - 'FirebasePerformance.podspec'
  14. # YML configuration file
  15. - '.github/workflows/performance.yml'
  16. # Re-usable workflows depended on by this file.
  17. - '.github/workflows/common.yml'
  18. - '.github/workflows/common_cocoapods.yml'
  19. - '.github/workflows/common_catalyst.yml'
  20. - '.github/workflows/common_quickstart.yml'
  21. - '.github/workflows/common_cocoapods_cron.yml'
  22. # Rebuild on Ruby infrastructure changes
  23. - 'Gemfile*'
  24. schedule:
  25. # Run every day at 12am (PDT) / 3am (EDT) - cron uses UTC times
  26. # Specified in format 'minutes hours day month dayofweek'
  27. - cron: '0 7 * * *'
  28. concurrency:
  29. group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
  30. cancel-in-progress: true
  31. jobs:
  32. spm:
  33. uses: ./.github/workflows/common.yml
  34. with:
  35. target: PerformanceUnit
  36. platforms: iOS, tvOS
  37. catalyst:
  38. uses: ./.github/workflows/common_catalyst.yml
  39. with:
  40. product: FirebasePerformance
  41. target:
  42. buildonly: true
  43. # Build and run the unit tests for Firebase performance SDK.
  44. performance:
  45. # Don't run on private repo unless it is a PR.
  46. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  47. runs-on: macos-15
  48. strategy:
  49. matrix:
  50. target: [iOS, tvOS]
  51. test: [unit, proddev]
  52. steps:
  53. - uses: actions/checkout@v4
  54. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  55. with:
  56. cache_key: ${{ matrix.target }}${{ matrix.test }}
  57. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  58. - name: Xcode
  59. run: sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer
  60. - name: Setup Bundler
  61. run: scripts/setup_bundler.sh
  62. - name: Install xcpretty
  63. run: gem install xcpretty
  64. - name: BuildAndTest # can be replaced with pod lib lint with CocoaPods 1.10
  65. run: scripts/third_party/travis/retry.sh scripts/build.sh Performance ${{ matrix.target }} ${{ matrix.test }}
  66. pod_lib_lint:
  67. uses: ./.github/workflows/common_cocoapods.yml
  68. with:
  69. product: FirebasePerformance
  70. platforms: iOS, tvOS
  71. #TODO: tests are not supported with Xcode 15 because the test spec depends on the iOS 8 GDCWebServer
  72. buildonly_platforms: iOS, tvOS
  73. # TODO: The legacy ObjC quickstarts don't run with Xcode 15, re-able if we get these working.
  74. quickstart:
  75. uses: ./.github/workflows/common_quickstart.yml
  76. with:
  77. product: Performance
  78. is_legacy: false
  79. quickstart_type: swift
  80. setup_command: scripts/setup_quickstart.sh performance
  81. plist_src_path: scripts/gha-encrypted/qs-performance.plist.gpg
  82. plist_dst_path: quickstart-ios/performance/GoogleService-Info.plist
  83. secrets:
  84. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  85. quickstart-ftl-cron-only:
  86. if: github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule'
  87. env:
  88. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  89. runs-on: macos-15
  90. steps:
  91. - uses: actions/checkout@v4
  92. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  93. - uses: actions/setup-python@v5
  94. with:
  95. python-version: '3.11'
  96. - name: Xcode
  97. run: sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer
  98. - name: Setup quickstart
  99. run: scripts/setup_quickstart.sh performance
  100. - name: Install Secret GoogleService-Info.plist
  101. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-performance.plist.gpg \
  102. quickstart-ios/performance/GoogleService-Info.plist "$plist_secret"
  103. - name: Build swift quickstart
  104. run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart_ftl.sh Performance swift)
  105. # - name: Build objc quickstart
  106. # run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart_ftl.sh Performance)
  107. - id: ftl_test
  108. uses: FirebaseExtended/github-actions/firebase-test-lab@v1.4
  109. with:
  110. credentials_json: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CREDENTIALS }}
  111. testapp_dir: quickstart-ios/build-for-testing
  112. test_type: "xctest"
  113. performance-cron-only:
  114. needs: pod_lib_lint
  115. uses: ./.github/workflows/common_cocoapods_cron.yml
  116. with:
  117. product: FirebasePerformance
  118. platforms: '[ "ios", "tvos" ]'
  119. flags: '[ "--skip-tests --use-static-frameworks" ]'