performance.yml 5.8 KB

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