performance.yml 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  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. on:
  5. pull_request:
  6. paths:
  7. # Performance sources
  8. - 'FirebasePerformance/**'
  9. # Podspec
  10. - 'FirebasePerformance.podspec'
  11. # YML configuration file
  12. - '.github/workflows/performance.yml'
  13. # Rebuild on Ruby infrastructure changes
  14. - 'Gemfile*'
  15. schedule:
  16. # Run every day at 11pm (PST) - cron uses UTC times
  17. # Specified in format 'minutes hours day month dayofweek'
  18. - cron: '0 7 * * *'
  19. concurrency:
  20. group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
  21. cancel-in-progress: true
  22. jobs:
  23. # Build and run the unit tests for Firebase performance SDK.
  24. performance:
  25. # Don't run on private repo unless it is a PR.
  26. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  27. runs-on: macos-12
  28. strategy:
  29. matrix:
  30. target: [iOS, tvOS]
  31. test: [unit, proddev]
  32. steps:
  33. - uses: actions/checkout@v4
  34. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  35. with:
  36. cache_key: ${{ matrix.target }}${{ matrix.test }}
  37. - uses: ruby/setup-ruby@v1
  38. - name: Setup Bundler
  39. run: scripts/setup_bundler.sh
  40. - name: Install xcpretty
  41. run: gem install xcpretty
  42. #TODO: Xcode 15 tests are blocked by #11903
  43. - name: BuildAndTest # can be replaced with pod lib lint with CocoaPods 1.10
  44. run: scripts/third_party/travis/retry.sh scripts/build.sh Performance ${{ matrix.target }} ${{ matrix.test }}
  45. # Podspec lint check for Firebase Performance
  46. pod-lib-lint:
  47. # Don't run on private repo unless it is a PR.
  48. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  49. strategy:
  50. matrix:
  51. target: [ios, tvos]
  52. os: [macos-14]
  53. xcode: [Xcode_15.2, Xcode_16]
  54. runs-on: ${{ matrix.os }}
  55. steps:
  56. - uses: actions/checkout@v4
  57. - uses: ruby/setup-ruby@v1
  58. - name: Setup Bundler
  59. run: scripts/setup_bundler.sh
  60. - name: Xcode
  61. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  62. - name: Build
  63. #TODO: tests are not supported with Xcode 15 because the test spec depends on the iOS 8 GDCWebServer
  64. run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebasePerformance.podspec --skip-tests --platforms=${{ matrix.target }}
  65. quickstart:
  66. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  67. env:
  68. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  69. signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  70. runs-on: macos-14
  71. steps:
  72. - uses: actions/checkout@v4
  73. - uses: ruby/setup-ruby@v1
  74. - name: Setup quickstart
  75. run: scripts/setup_quickstart.sh performance
  76. - name: Install Secret GoogleService-Info.plist
  77. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-performance.plist.gpg \
  78. quickstart-ios/performance/GoogleService-Info.plist "$plist_secret"
  79. - name: Test swift quickstart
  80. run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Performance true swift)
  81. # TODO: The legacy ObjC quickstarts don't run with Xcode 15, re-able if we get these working.
  82. # - name: Test objc quickstart
  83. # run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Performance true)
  84. quickstart-ftl-cron-only:
  85. if: github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule'
  86. env:
  87. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  88. signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  89. runs-on: macos-14
  90. steps:
  91. - uses: actions/checkout@v4
  92. - uses: ruby/setup-ruby@v1
  93. - uses: actions/setup-python@v5
  94. with:
  95. python-version: '3.11'
  96. - name: Setup quickstart
  97. run: scripts/setup_quickstart.sh performance
  98. - name: Install Secret GoogleService-Info.plist
  99. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-performance.plist.gpg \
  100. quickstart-ios/performance/GoogleService-Info.plist "$plist_secret"
  101. - name: Build swift quickstart
  102. run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart_ftl.sh Performance swift)
  103. # - name: Build objc quickstart
  104. # run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart_ftl.sh Performance)
  105. - id: ftl_test
  106. uses: FirebaseExtended/github-actions/firebase-test-lab@v1.4
  107. with:
  108. credentials_json: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CREDENTIALS }}
  109. testapp_dir: quickstart-ios/build-for-testing
  110. test_type: "xctest"
  111. spm-package-resolved:
  112. env:
  113. FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
  114. runs-on: macos-14
  115. outputs:
  116. cache_key: ${{ steps.generate_cache_key.outputs.cache_key }}
  117. steps:
  118. - uses: actions/checkout@v4
  119. - name: Generate Swift Package.resolved
  120. id: swift_package_resolve
  121. run: |
  122. swift package resolve
  123. - name: Generate cache key
  124. id: generate_cache_key
  125. run: |
  126. cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}"
  127. echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT"
  128. - uses: actions/cache/save@v4
  129. id: cache
  130. with:
  131. path: .build
  132. key: ${{ steps.generate_cache_key.outputs.cache_key }}
  133. spm:
  134. # Don't run on private repo unless it is a PR.
  135. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  136. needs: [spm-package-resolved]
  137. strategy:
  138. matrix:
  139. include:
  140. - os: macos-13
  141. xcode: Xcode_15.2
  142. target: iOS
  143. - os: macos-14
  144. xcode: Xcode_15.4
  145. target: iOS
  146. - os: macos-15
  147. xcode: Xcode_16
  148. target: iOS
  149. - os: macos-15
  150. xcode: Xcode_16
  151. target: tvOS
  152. runs-on: ${{ matrix.os }}
  153. steps:
  154. - uses: actions/checkout@v4
  155. - uses: actions/cache/restore@v4
  156. with:
  157. path: .build
  158. key: ${{needs.spm-package-resolved.outputs.cache_key}}
  159. - name: Xcode
  160. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  161. - name: Initialize xcodebuild
  162. run: scripts/setup_spm_tests.sh
  163. - name: Unit Tests
  164. run: scripts/third_party/travis/retry.sh ./scripts/build.sh PerformanceUnit ${{ matrix.target }} spm
  165. catalyst:
  166. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  167. runs-on: macos-14
  168. steps:
  169. - uses: actions/checkout@v4
  170. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  171. with:
  172. cache_key: catalyst
  173. - uses: ruby/setup-ruby@v1
  174. - name: Setup Bundler
  175. run: scripts/setup_bundler.sh
  176. - name: Setup project and Build Catalyst
  177. run: scripts/test_catalyst.sh FirebasePerformance build
  178. performance-cron-only:
  179. # Don't run on private repo.
  180. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  181. runs-on: macos-14
  182. strategy:
  183. matrix:
  184. target: [ios, tvos]
  185. flags: [
  186. '--skip-tests --use-static-frameworks'
  187. ]
  188. needs: pod-lib-lint
  189. steps:
  190. - uses: actions/checkout@v4
  191. - uses: ruby/setup-ruby@v1
  192. - name: Setup Bundler
  193. run: scripts/setup_bundler.sh
  194. - name: PodLibLint Performance Cron
  195. run: |
  196. scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebasePerformance.podspec --platforms=${{ matrix.target }} ${{ matrix.flags }}