performance.yml 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  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, macos-13]
  53. include:
  54. - os: macos-14
  55. xcode: Xcode_15.3
  56. - os: macos-13
  57. xcode: Xcode_15.2
  58. runs-on: ${{ matrix.os }}
  59. steps:
  60. - uses: actions/checkout@v4
  61. - uses: ruby/setup-ruby@v1
  62. - name: Setup Bundler
  63. run: scripts/setup_bundler.sh
  64. - name: Xcode
  65. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  66. - name: Build
  67. #TODO: tests are not supported with Xcode 15 because the test spec depends on the iOS 8 GDCWebServer
  68. run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebasePerformance.podspec --skip-tests --platforms=${{ matrix.target }}
  69. quickstart:
  70. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  71. env:
  72. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  73. signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  74. runs-on: macos-12 # TODO: the legacy ObjC quickstarts don't run with Xcode 15.
  75. steps:
  76. - uses: actions/checkout@v4
  77. - uses: ruby/setup-ruby@v1
  78. - name: Setup quickstart
  79. run: scripts/setup_quickstart.sh performance
  80. - name: Install Secret GoogleService-Info.plist
  81. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-performance.plist.gpg \
  82. quickstart-ios/performance/GoogleService-Info.plist "$plist_secret"
  83. - name: Test swift quickstart
  84. run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Performance true swift)
  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@v4
  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:
  115. # Don't run on private repo unless it is a PR.
  116. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  117. strategy:
  118. matrix:
  119. target: [iOS, tvOS]
  120. include:
  121. - os: macos-14
  122. xcode: Xcode_15.3
  123. - os: macos-13
  124. xcode: Xcode_15.2
  125. runs-on: ${{ matrix.os }}
  126. steps:
  127. - uses: actions/checkout@v4
  128. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  129. with:
  130. cache_key: spm${{ matrix.os }}-${{ matrix.xcode }}-${{ matrix.target }}
  131. - name: Xcode
  132. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  133. - name: Initialize xcodebuild
  134. run: scripts/setup_spm_tests.sh
  135. - name: Unit Tests
  136. run: scripts/third_party/travis/retry.sh ./scripts/build.sh PerformanceUnit ${{ matrix.target }} spm
  137. catalyst:
  138. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  139. runs-on: macos-14
  140. steps:
  141. - uses: actions/checkout@v4
  142. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  143. with:
  144. cache_key: catalyst
  145. - uses: ruby/setup-ruby@v1
  146. - name: Setup Bundler
  147. run: scripts/setup_bundler.sh
  148. - name: Setup project and Build Catalyst
  149. run: scripts/test_catalyst.sh FirebasePerformance build
  150. performance-cron-only:
  151. # Don't run on private repo.
  152. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  153. runs-on: macos-14
  154. strategy:
  155. matrix:
  156. target: [ios, tvos]
  157. flags: [
  158. '--skip-tests --use-static-frameworks'
  159. ]
  160. needs: pod-lib-lint
  161. steps:
  162. - uses: actions/checkout@v4
  163. - uses: ruby/setup-ruby@v1
  164. - name: Setup Bundler
  165. run: scripts/setup_bundler.sh
  166. - name: PodLibLint Performance Cron
  167. run: |
  168. scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebasePerformance.podspec --platforms=${{ matrix.target }} ${{ matrix.flags }}