performance.yml 7.9 KB

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