performance.yml 8.6 KB

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