performance.yml 5.8 KB

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