performance.yml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. # Merge the yml file to master 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. pull_request:
  6. paths:
  7. # Performance sources
  8. - 'FirebasePerformance/**'
  9. # Podspec
  10. - 'FirebasePerformance.podspec'
  11. # YML configuration file
  12. - '.github/workflows/performance.yml'
  13. # Rebuild on Ruby infrastructure changes
  14. - 'Gemfile*'
  15. schedule:
  16. # Run every day at 11pm (PST) - cron uses UTC times
  17. # Specified in format 'minutes hours day month dayofweek'
  18. - cron: '0 7 * * *'
  19. concurrency:
  20. group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
  21. cancel-in-progress: true
  22. jobs:
  23. # Build and run the unit tests for Firebase performance SDK.
  24. performance:
  25. # Don't run on private repo unless it is a PR.
  26. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  27. runs-on: macos-12
  28. strategy:
  29. matrix:
  30. target: [iOS, tvOS]
  31. test: [unit, proddev]
  32. steps:
  33. - uses: actions/checkout@v3
  34. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  35. with:
  36. cache_key: ${{ matrix.os }}
  37. - uses: ruby/setup-ruby@v1
  38. - name: Setup Bundler
  39. run: scripts/setup_bundler.sh
  40. - name: Install xcpretty
  41. run: gem install xcpretty
  42. - name: BuildAndTest # can be replaced with pod lib lint with CocoaPods 1.10
  43. run: scripts/third_party/travis/retry.sh scripts/build.sh Performance ${{ matrix.target }} ${{ matrix.test }}
  44. # Podspec lint check for Firebase Performance
  45. pod-lib-lint:
  46. # Don't run on private repo unless it is a PR.
  47. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  48. runs-on: macos-12
  49. strategy:
  50. matrix:
  51. target: [ios, tvos]
  52. steps:
  53. - uses: actions/checkout@v3
  54. - uses: ruby/setup-ruby@v1
  55. - name: Setup Bundler
  56. run: scripts/setup_bundler.sh
  57. - name: Build
  58. run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebasePerformance.podspec --skip-tests --platforms=${{ matrix.target }}
  59. quickstart:
  60. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  61. env:
  62. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  63. signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  64. runs-on: macos-12
  65. steps:
  66. - uses: actions/checkout@v3
  67. - uses: actions/checkout@v3
  68. - uses: ruby/setup-ruby@v1
  69. - name: Setup quickstart
  70. run: scripts/setup_quickstart.sh performance
  71. - name: Install Secret GoogleService-Info.plist
  72. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-performance.plist.gpg \
  73. quickstart-ios/performance/GoogleService-Info.plist "$plist_secret"
  74. - name: Test swift quickstart
  75. run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Performance true)
  76. - name: Test objc quickstart
  77. run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Performance true)
  78. spm:
  79. # Don't run on private repo unless it is a PR.
  80. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  81. runs-on: macos-12
  82. strategy:
  83. matrix:
  84. target: [iOS]
  85. steps:
  86. - uses: actions/checkout@v3
  87. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  88. with:
  89. cache_key: ${{ matrix.os }}
  90. - name: Initialize xcodebuild
  91. run: scripts/setup_spm_tests.sh
  92. - name: Unit Tests
  93. run: scripts/third_party/travis/retry.sh ./scripts/build.sh PerformanceUnit ${{ matrix.target }} spm
  94. spm-cron:
  95. # Don't run on private repo.
  96. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  97. runs-on: macos-12
  98. strategy:
  99. matrix:
  100. target: [tvOS]
  101. steps:
  102. - uses: actions/checkout@v3
  103. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  104. with:
  105. cache_key: ${{ matrix.os }}
  106. - name: Initialize xcodebuild
  107. run: scripts/setup_spm_tests.sh
  108. - name: Unit Tests
  109. run: scripts/third_party/travis/retry.sh ./scripts/build.sh PerformanceUnit ${{ matrix.target }} spm
  110. catalyst:
  111. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  112. runs-on: macos-12
  113. steps:
  114. - uses: actions/checkout@v3
  115. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  116. with:
  117. cache_key: ${{ matrix.os }}
  118. - uses: ruby/setup-ruby@v1
  119. - name: Setup Bundler
  120. run: scripts/setup_bundler.sh
  121. - name: Setup project and Build Catalyst
  122. run: scripts/test_catalyst.sh FirebasePerformance build
  123. performance-cron-only:
  124. # Don't run on private repo.
  125. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  126. runs-on: macos-12
  127. strategy:
  128. matrix:
  129. target: [ios, tvos]
  130. flags: [
  131. '--skip-tests --use-static-frameworks'
  132. ]
  133. needs: pod-lib-lint
  134. steps:
  135. - uses: actions/checkout@v3
  136. - uses: ruby/setup-ruby@v1
  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 }}