performance.yml 5.9 KB

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