performance.yml 5.2 KB

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