performance.yml 6.7 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. - 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. runs-on: macos-12
  49. strategy:
  50. matrix:
  51. target: [ios, tvos]
  52. steps:
  53. - uses: actions/checkout@v3
  54. - uses: ruby/setup-ruby@v1
  55. - name: Setup Bundler
  56. run: scripts/setup_bundler.sh
  57. - name: Build
  58. run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebasePerformance.podspec --skip-tests --platforms=${{ matrix.target }}
  59. quickstart:
  60. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  61. env:
  62. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  63. signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  64. runs-on: macos-12
  65. steps:
  66. - uses: actions/checkout@v3
  67. - uses: ruby/setup-ruby@v1
  68. - name: Setup quickstart
  69. run: scripts/setup_quickstart.sh performance
  70. - name: Install Secret GoogleService-Info.plist
  71. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-performance.plist.gpg \
  72. quickstart-ios/performance/GoogleService-Info.plist "$plist_secret"
  73. - name: Test swift quickstart
  74. run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Performance true swift)
  75. - name: Test objc quickstart
  76. run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Performance true)
  77. quickstart-ftl-cron-only:
  78. if: github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule'
  79. env:
  80. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  81. signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  82. runs-on: macos-12
  83. steps:
  84. - uses: actions/checkout@v3
  85. - uses: ruby/setup-ruby@v1
  86. - name: Setup quickstart
  87. run: scripts/setup_quickstart.sh performance
  88. - name: Install Secret GoogleService-Info.plist
  89. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-performance.plist.gpg \
  90. quickstart-ios/performance/GoogleService-Info.plist "$plist_secret"
  91. - name: Build swift quickstart
  92. run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart_ftl.sh Performance swift)
  93. # - name: Build objc quickstart
  94. # run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart_ftl.sh Performance)
  95. - id: ftl_test
  96. uses: FirebaseExtended/github-actions/firebase-test-lab@v1.2
  97. with:
  98. credentials_json: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CREDENTIALS }}
  99. testapp_dir: quickstart-ios/build-for-testing
  100. test_type: "xctest"
  101. spm:
  102. # Don't run on private repo unless it is a PR.
  103. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  104. runs-on: macos-12
  105. strategy:
  106. matrix:
  107. target: [iOS]
  108. steps:
  109. - uses: actions/checkout@v3
  110. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  111. with:
  112. cache_key: ${{ matrix.os }}
  113. - name: Initialize xcodebuild
  114. run: scripts/setup_spm_tests.sh
  115. - name: Unit Tests
  116. run: scripts/third_party/travis/retry.sh ./scripts/build.sh PerformanceUnit ${{ matrix.target }} spm
  117. spm-cron:
  118. # Don't run on private repo.
  119. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  120. runs-on: macos-12
  121. strategy:
  122. matrix:
  123. target: [tvOS]
  124. steps:
  125. - uses: actions/checkout@v3
  126. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  127. with:
  128. cache_key: ${{ matrix.os }}
  129. - name: Initialize xcodebuild
  130. run: scripts/setup_spm_tests.sh
  131. - name: Unit Tests
  132. run: scripts/third_party/travis/retry.sh ./scripts/build.sh PerformanceUnit ${{ matrix.target }} spm
  133. catalyst:
  134. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  135. runs-on: macos-12
  136. steps:
  137. - uses: actions/checkout@v3
  138. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  139. with:
  140. cache_key: ${{ matrix.os }}
  141. - uses: ruby/setup-ruby@v1
  142. - name: Setup Bundler
  143. run: scripts/setup_bundler.sh
  144. - name: Setup project and Build Catalyst
  145. run: scripts/test_catalyst.sh FirebasePerformance build
  146. performance-cron-only:
  147. # Don't run on private repo.
  148. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  149. runs-on: macos-12
  150. strategy:
  151. matrix:
  152. target: [ios, tvos]
  153. flags: [
  154. '--skip-tests --use-static-frameworks'
  155. ]
  156. needs: pod-lib-lint
  157. steps:
  158. - uses: actions/checkout@v3
  159. - uses: ruby/setup-ruby@v1
  160. - name: Setup Bundler
  161. run: scripts/setup_bundler.sh
  162. - name: PodLibLint Performance Cron
  163. run: |
  164. scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebasePerformance.podspec --platforms=${{ matrix.target }} ${{ matrix.flags }}