performance.yml 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  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. workflow_dispatch:
  6. pull_request:
  7. paths:
  8. # Performance sources
  9. - 'FirebasePerformance/**'
  10. # Podspec
  11. - 'FirebasePerformance.podspec'
  12. # YML configuration file
  13. - '.github/workflows/performance.yml'
  14. # Rebuild on Ruby infrastructure changes
  15. - 'Gemfile*'
  16. schedule:
  17. # Run every day at 11pm (PST) - cron uses UTC times
  18. # Specified in format 'minutes hours day month dayofweek'
  19. - cron: '0 7 * * *'
  20. concurrency:
  21. group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
  22. cancel-in-progress: true
  23. jobs:
  24. spm:
  25. uses: ./.github/workflows/common.yml
  26. with:
  27. target: PerformanceUnit
  28. platforms: iOS, tvOS
  29. catalyst:
  30. uses: ./.github/workflows/common_catalyst.yml
  31. with:
  32. product: FirebasePerformance
  33. target:
  34. buildonly: true
  35. # Build and run the unit tests for Firebase performance SDK.
  36. performance:
  37. # Don't run on private repo unless it is a PR.
  38. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  39. runs-on: macos-15
  40. strategy:
  41. matrix:
  42. target: [iOS, tvOS]
  43. test: [unit, proddev]
  44. steps:
  45. - uses: actions/checkout@v4
  46. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  47. with:
  48. cache_key: ${{ matrix.target }}${{ matrix.test }}
  49. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  50. - name: Xcode
  51. run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
  52. - name: Setup Bundler
  53. run: scripts/setup_bundler.sh
  54. - name: Install xcpretty
  55. run: gem install xcpretty
  56. - name: BuildAndTest # can be replaced with pod lib lint with CocoaPods 1.10
  57. run: scripts/third_party/travis/retry.sh scripts/build.sh Performance ${{ matrix.target }} ${{ matrix.test }}
  58. # Podspec lint check for Firebase Performance
  59. pod-lib-lint:
  60. # Don't run on private repo unless it is a PR.
  61. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  62. strategy:
  63. matrix:
  64. target: [ios, tvos]
  65. build-env:
  66. - os: macos-14
  67. xcode: Xcode_16.2
  68. - os: macos-15
  69. xcode: Xcode_16.3
  70. runs-on: ${{ matrix.build-env.os }}
  71. steps:
  72. - uses: actions/checkout@v4
  73. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  74. - name: Setup Bundler
  75. run: scripts/setup_bundler.sh
  76. - name: Xcode
  77. run: sudo xcode-select -s /Applications/${{ matrix.build-env.xcode }}.app/Contents/Developer
  78. - name: Build
  79. #TODO: tests are not supported with Xcode 15 because the test spec depends on the iOS 8 GDCWebServer
  80. run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebasePerformance.podspec --skip-tests --platforms=${{ matrix.target }}
  81. quickstart:
  82. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  83. env:
  84. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  85. signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  86. runs-on: macos-15
  87. steps:
  88. - uses: actions/checkout@v4
  89. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  90. - name: Xcode
  91. run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
  92. - name: Setup quickstart
  93. run: scripts/setup_quickstart.sh performance
  94. - name: Install Secret GoogleService-Info.plist
  95. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-performance.plist.gpg \
  96. quickstart-ios/performance/GoogleService-Info.plist "$plist_secret"
  97. - name: Test swift quickstart
  98. run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Performance true swift)
  99. # TODO: The legacy ObjC quickstarts don't run with Xcode 15, re-able if we get these working.
  100. # - name: Test objc quickstart
  101. # run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Performance true)
  102. quickstart-ftl-cron-only:
  103. if: github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule'
  104. env:
  105. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  106. signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  107. runs-on: macos-15
  108. steps:
  109. - uses: actions/checkout@v4
  110. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  111. - uses: actions/setup-python@v5
  112. with:
  113. python-version: '3.11'
  114. - name: Xcode
  115. run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
  116. - name: Setup quickstart
  117. run: scripts/setup_quickstart.sh performance
  118. - name: Install Secret GoogleService-Info.plist
  119. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-performance.plist.gpg \
  120. quickstart-ios/performance/GoogleService-Info.plist "$plist_secret"
  121. - name: Build swift quickstart
  122. run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart_ftl.sh Performance swift)
  123. # - name: Build objc quickstart
  124. # run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart_ftl.sh Performance)
  125. - id: ftl_test
  126. uses: FirebaseExtended/github-actions/firebase-test-lab@v1.4
  127. with:
  128. credentials_json: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CREDENTIALS }}
  129. testapp_dir: quickstart-ios/build-for-testing
  130. test_type: "xctest"
  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-15
  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@v4
  144. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  145. - name: Xcode
  146. run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
  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 }}