performance.yml 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  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. runs-on: macos-15
  76. steps:
  77. - uses: actions/checkout@v4
  78. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  79. - name: Xcode
  80. run: sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer
  81. - name: Setup quickstart
  82. run: scripts/setup_quickstart.sh performance
  83. - name: Install Secret GoogleService-Info.plist
  84. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-performance.plist.gpg \
  85. quickstart-ios/performance/GoogleService-Info.plist "$plist_secret"
  86. - name: Test swift quickstart
  87. run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Performance true swift)
  88. # TODO: The legacy ObjC quickstarts don't run with Xcode 15, re-able if we get these working.
  89. # - name: Test objc quickstart
  90. # run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Performance true)
  91. quickstart-ftl-cron-only:
  92. if: github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule'
  93. env:
  94. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  95. runs-on: macos-15
  96. steps:
  97. - uses: actions/checkout@v4
  98. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  99. - uses: actions/setup-python@v5
  100. with:
  101. python-version: '3.11'
  102. - name: Xcode
  103. run: sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer
  104. - name: Setup quickstart
  105. run: scripts/setup_quickstart.sh performance
  106. - name: Install Secret GoogleService-Info.plist
  107. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-performance.plist.gpg \
  108. quickstart-ios/performance/GoogleService-Info.plist "$plist_secret"
  109. - name: Build swift quickstart
  110. run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart_ftl.sh Performance swift)
  111. # - name: Build objc quickstart
  112. # run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart_ftl.sh Performance)
  113. - id: ftl_test
  114. uses: FirebaseExtended/github-actions/firebase-test-lab@v1.4
  115. with:
  116. credentials_json: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CREDENTIALS }}
  117. testapp_dir: quickstart-ios/build-for-testing
  118. test_type: "xctest"
  119. performance-cron-only:
  120. # Don't run on private repo.
  121. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  122. runs-on: macos-15
  123. strategy:
  124. matrix:
  125. target: [ios, tvos]
  126. flags: [
  127. '--skip-tests --use-static-frameworks'
  128. ]
  129. needs: pod_lib_lint
  130. steps:
  131. - uses: actions/checkout@v4
  132. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  133. - name: Xcode
  134. run: sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer
  135. - name: Setup Bundler
  136. run: scripts/setup_bundler.sh
  137. - name: PodLibLint Performance Cron
  138. run: |
  139. scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebasePerformance.podspec --platforms=${{ matrix.target }} ${{ matrix.flags }}