performance.yml 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  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-14
  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. - name: BuildAndTest # can be replaced with pod lib lint with CocoaPods 1.10
  43. run: scripts/third_party/travis/retry.sh scripts/build.sh Performance ${{ matrix.target }} ${{ matrix.test }}
  44. # Podspec lint check for Firebase Performance
  45. pod-lib-lint:
  46. # Don't run on private repo unless it is a PR.
  47. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  48. strategy:
  49. matrix:
  50. target: [ios, tvos]
  51. build-env:
  52. - os: macos-14
  53. xcode: Xcode_15.2
  54. - os: macos-15
  55. xcode: Xcode_16.1
  56. runs-on: ${{ matrix.build-env.os }}
  57. steps:
  58. - uses: actions/checkout@v4
  59. - uses: ruby/setup-ruby@v1
  60. - name: Setup Bundler
  61. run: scripts/setup_bundler.sh
  62. - name: Xcode
  63. run: sudo xcode-select -s /Applications/${{ matrix.build-env.xcode }}.app/Contents/Developer
  64. - name: Build
  65. #TODO: tests are not supported with Xcode 15 because the test spec depends on the iOS 8 GDCWebServer
  66. run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebasePerformance.podspec --skip-tests --platforms=${{ matrix.target }}
  67. quickstart:
  68. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  69. env:
  70. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  71. signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  72. runs-on: macos-14
  73. steps:
  74. - uses: actions/checkout@v4
  75. - uses: ruby/setup-ruby@v1
  76. - name: Setup quickstart
  77. run: scripts/setup_quickstart.sh performance
  78. - name: Install Secret GoogleService-Info.plist
  79. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-performance.plist.gpg \
  80. quickstart-ios/performance/GoogleService-Info.plist "$plist_secret"
  81. - name: Test swift quickstart
  82. run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Performance true swift)
  83. # TODO: The legacy ObjC quickstarts don't run with Xcode 15, re-able if we get these working.
  84. # - name: Test objc quickstart
  85. # run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Performance true)
  86. quickstart-ftl-cron-only:
  87. if: github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule'
  88. env:
  89. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  90. signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  91. runs-on: macos-14
  92. steps:
  93. - uses: actions/checkout@v4
  94. - uses: ruby/setup-ruby@v1
  95. - uses: actions/setup-python@v5
  96. with:
  97. python-version: '3.11'
  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. spm-package-resolved:
  114. env:
  115. FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
  116. runs-on: macos-14
  117. outputs:
  118. cache_key: ${{ steps.generate_cache_key.outputs.cache_key }}
  119. steps:
  120. - uses: actions/checkout@v4
  121. - name: Generate Swift Package.resolved
  122. id: swift_package_resolve
  123. run: |
  124. swift package resolve
  125. - name: Generate cache key
  126. id: generate_cache_key
  127. run: |
  128. cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}"
  129. echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT"
  130. - uses: actions/cache/save@v4
  131. id: cache
  132. with:
  133. path: .build
  134. key: ${{ steps.generate_cache_key.outputs.cache_key }}
  135. spm:
  136. # Don't run on private repo unless it is a PR.
  137. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  138. needs: [spm-package-resolved]
  139. strategy:
  140. matrix:
  141. include:
  142. - os: macos-13
  143. xcode: Xcode_15.2
  144. target: iOS
  145. - os: macos-14
  146. xcode: Xcode_15.4
  147. target: iOS
  148. - os: macos-15
  149. xcode: Xcode_16.1
  150. target: iOS
  151. - os: macos-15
  152. xcode: Xcode_16.1
  153. target: tvOS
  154. runs-on: ${{ matrix.os }}
  155. steps:
  156. - uses: actions/checkout@v4
  157. - uses: actions/cache/restore@v4
  158. with:
  159. path: .build
  160. key: ${{needs.spm-package-resolved.outputs.cache_key}}
  161. - name: Xcode
  162. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  163. - name: Initialize xcodebuild
  164. run: scripts/setup_spm_tests.sh
  165. - name: Unit Tests
  166. run: scripts/third_party/travis/retry.sh ./scripts/build.sh PerformanceUnit ${{ matrix.target }} spm
  167. catalyst:
  168. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  169. runs-on: macos-14
  170. steps:
  171. - uses: actions/checkout@v4
  172. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  173. with:
  174. cache_key: catalyst
  175. - uses: ruby/setup-ruby@v1
  176. - name: Setup Bundler
  177. run: scripts/setup_bundler.sh
  178. - name: Setup project and Build Catalyst
  179. run: scripts/test_catalyst.sh FirebasePerformance build
  180. performance-cron-only:
  181. # Don't run on private repo.
  182. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  183. runs-on: macos-14
  184. strategy:
  185. matrix:
  186. target: [ios, tvos]
  187. flags: [
  188. '--skip-tests --use-static-frameworks'
  189. ]
  190. needs: pod-lib-lint
  191. steps:
  192. - uses: actions/checkout@v4
  193. - uses: ruby/setup-ruby@v1
  194. - name: Setup Bundler
  195. run: scripts/setup_bundler.sh
  196. - name: PodLibLint Performance Cron
  197. run: |
  198. scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebasePerformance.podspec --platforms=${{ matrix.target }} ${{ matrix.flags }}