performance.yml 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  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@v2
  34. - uses: mikehardy/buildcache-action@50738c6c77de7f34e66b870e4f8ede333b69d077
  35. with:
  36. cache_key: ${{ matrix.os }}
  37. - uses: ruby/setup-ruby@359bebbc29cbe6c87da6bc9ea3bc930432750108
  38. with:
  39. ruby-version: '2.7'
  40. - name: Setup Bundler
  41. run: scripts/setup_bundler.sh
  42. - name: Install xcpretty
  43. run: gem install xcpretty
  44. - name: BuildAndTest # can be replaced with pod lib lint with CocoaPods 1.10
  45. run: scripts/third_party/travis/retry.sh scripts/build.sh Performance ${{ matrix.target }} ${{ matrix.test }}
  46. # Podspec lint check for Firebase Performance
  47. pod-lib-lint:
  48. # Don't run on private repo unless it is a PR.
  49. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  50. runs-on: macos-12
  51. strategy:
  52. matrix:
  53. target: [ios, tvos]
  54. steps:
  55. - uses: actions/checkout@v2
  56. - uses: ruby/setup-ruby@359bebbc29cbe6c87da6bc9ea3bc930432750108
  57. with:
  58. ruby-version: '2.7'
  59. - name: Setup Bundler
  60. run: scripts/setup_bundler.sh
  61. - name: Build
  62. run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebasePerformance.podspec --skip-tests --platforms=${{ matrix.target }}
  63. quickstart:
  64. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  65. env:
  66. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  67. signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  68. runs-on: macos-12
  69. steps:
  70. - uses: actions/checkout@v2
  71. - uses: actions/checkout@v2
  72. - uses: ruby/setup-ruby@359bebbc29cbe6c87da6bc9ea3bc930432750108
  73. with:
  74. ruby-version: '2.7'
  75. - name: Setup quickstart
  76. run: scripts/setup_quickstart.sh performance
  77. - name: Install Secret GoogleService-Info.plist
  78. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-performance.plist.gpg \
  79. quickstart-ios/performance/GoogleService-Info.plist "$plist_secret"
  80. - name: Test swift quickstart
  81. run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Performance true)
  82. - name: Test objc quickstart
  83. run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Performance true)
  84. spm:
  85. # Don't run on private repo unless it is a PR.
  86. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  87. runs-on: macos-12
  88. strategy:
  89. matrix:
  90. target: [iOS]
  91. steps:
  92. - uses: actions/checkout@v2
  93. - uses: mikehardy/buildcache-action@50738c6c77de7f34e66b870e4f8ede333b69d077
  94. with:
  95. cache_key: ${{ matrix.os }}
  96. - name: Initialize xcodebuild
  97. run: scripts/setup_spm_tests.sh
  98. - name: Unit Tests
  99. run: scripts/third_party/travis/retry.sh ./scripts/build.sh PerformanceUnit ${{ matrix.target }} spm
  100. spm-cron:
  101. # Don't run on private repo.
  102. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  103. runs-on: macos-12
  104. strategy:
  105. matrix:
  106. target: [tvOS]
  107. steps:
  108. - uses: actions/checkout@v2
  109. - uses: mikehardy/buildcache-action@50738c6c77de7f34e66b870e4f8ede333b69d077
  110. with:
  111. cache_key: ${{ matrix.os }}
  112. - name: Initialize xcodebuild
  113. run: scripts/setup_spm_tests.sh
  114. - name: Unit Tests
  115. run: scripts/third_party/travis/retry.sh ./scripts/build.sh PerformanceUnit ${{ matrix.target }} spm
  116. catalyst:
  117. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  118. runs-on: macos-12
  119. steps:
  120. - uses: actions/checkout@v2
  121. - uses: mikehardy/buildcache-action@50738c6c77de7f34e66b870e4f8ede333b69d077
  122. with:
  123. cache_key: ${{ matrix.os }}
  124. - uses: ruby/setup-ruby@359bebbc29cbe6c87da6bc9ea3bc930432750108
  125. with:
  126. ruby-version: '2.7'
  127. - name: Setup Bundler
  128. run: scripts/setup_bundler.sh
  129. - name: Setup project and Build Catalyst
  130. run: scripts/test_catalyst.sh FirebasePerformance build
  131. performance-cron-only:
  132. # Don't run on private repo.
  133. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  134. runs-on: macos-12
  135. strategy:
  136. matrix:
  137. target: [ios, tvos]
  138. flags: [
  139. '--skip-tests --use-static-frameworks'
  140. ]
  141. needs: pod-lib-lint
  142. steps:
  143. - uses: actions/checkout@v2
  144. - uses: ruby/setup-ruby@359bebbc29cbe6c87da6bc9ea3bc930432750108
  145. with:
  146. ruby-version: '2.7'
  147. - name: Setup Bundler
  148. run: scripts/setup_bundler.sh
  149. - name: PodLibLint Performance Cron
  150. run: |
  151. scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebasePerformance.podspec --platforms=${{ matrix.target }} ${{ matrix.flags }}