performance.yml 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. # Merge the yml file to master 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@v3
  34. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  35. with:
  36. cache_key: ${{ matrix.os }}
  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-12, macos-13]
  53. include:
  54. - os: macos-12
  55. xcode: Xcode_14.2
  56. - os: macos-13
  57. xcode: Xcode_15.0.1
  58. runs-on: ${{ matrix.os }}
  59. steps:
  60. - uses: actions/checkout@v3
  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
  75. steps:
  76. - uses: actions/checkout@v3
  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-12
  93. steps:
  94. - uses: actions/checkout@v3
  95. - uses: ruby/setup-ruby@v1
  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.2
  107. with:
  108. credentials_json: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CREDENTIALS }}
  109. testapp_dir: quickstart-ios/build-for-testing
  110. test_type: "xctest"
  111. spm:
  112. # Don't run on private repo unless it is a PR.
  113. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  114. strategy:
  115. matrix:
  116. target: [iOS, tvOS]
  117. include:
  118. - os: macos-12
  119. xcode: Xcode_14.2
  120. - os: macos-13
  121. xcode: Xcode_15.0.1
  122. runs-on: ${{ matrix.os }}
  123. steps:
  124. - uses: actions/checkout@v3
  125. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  126. with:
  127. cache_key: ${{ matrix.os }}
  128. - name: Xcode
  129. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  130. - name: Initialize xcodebuild
  131. run: scripts/setup_spm_tests.sh
  132. - name: Unit Tests
  133. run: scripts/third_party/travis/retry.sh ./scripts/build.sh PerformanceUnit ${{ matrix.target }} spm
  134. catalyst:
  135. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  136. runs-on: macos-12
  137. steps:
  138. - uses: actions/checkout@v3
  139. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  140. with:
  141. cache_key: ${{ matrix.os }}
  142. - uses: ruby/setup-ruby@v1
  143. - name: Setup Bundler
  144. run: scripts/setup_bundler.sh
  145. - name: Setup project and Build Catalyst
  146. run: scripts/test_catalyst.sh FirebasePerformance build
  147. performance-cron-only:
  148. # Don't run on private repo.
  149. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  150. runs-on: macos-12
  151. strategy:
  152. matrix:
  153. target: [ios, tvos]
  154. flags: [
  155. '--skip-tests --use-static-frameworks'
  156. ]
  157. needs: pod-lib-lint
  158. steps:
  159. - uses: actions/checkout@v3
  160. - uses: ruby/setup-ruby@v1
  161. - name: Setup Bundler
  162. run: scripts/setup_bundler.sh
  163. - name: PodLibLint Performance Cron
  164. run: |
  165. scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebasePerformance.podspec --platforms=${{ matrix.target }} ${{ matrix.flags }}