performance.yml 5.9 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. jobs:
  20. # Build and run the unit tests for Firebase performance SDK.
  21. performance:
  22. # Don't run on private repo unless it is a PR.
  23. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  24. runs-on: macos-11
  25. strategy:
  26. matrix:
  27. target: [iOS, tvOS]
  28. test: [unit, proddev]
  29. steps:
  30. - uses: actions/checkout@v2
  31. - uses: mikehardy/buildcache-action@50738c6c77de7f34e66b870e4f8ede333b69d077
  32. with:
  33. cache_key: ${{ matrix.os }}
  34. - name: Setup Bundler
  35. run: scripts/setup_bundler.sh
  36. - name: BuildAndTest # can be replaced with pod lib lint with CocoaPods 1.10
  37. run: scripts/third_party/travis/retry.sh scripts/build.sh Performance ${{ matrix.target }} ${{ matrix.test }}
  38. # Podspec lint check for Firebase Performance
  39. pod-lib-lint:
  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-11
  43. strategy:
  44. matrix:
  45. target: [ios, tvos]
  46. steps:
  47. - uses: actions/checkout@v2
  48. - name: Setup Bundler
  49. run: scripts/setup_bundler.sh
  50. - name: Build
  51. run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebasePerformance.podspec --skip-tests --platforms=${{ matrix.target }}
  52. quickstart:
  53. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  54. env:
  55. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  56. signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  57. runs-on: macos-11
  58. steps:
  59. - uses: actions/checkout@v2
  60. - name: Setup quickstart
  61. run: scripts/setup_quickstart.sh performance
  62. - name: Install Secret GoogleService-Info.plist
  63. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-performance.plist.gpg \
  64. quickstart-ios/performance/GoogleService-Info.plist "$plist_secret"
  65. - name: Test swift quickstart
  66. run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Performance true)
  67. - name: Test objc quickstart
  68. run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Performance true)
  69. spm:
  70. # Don't run on private repo unless it is a PR.
  71. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  72. runs-on: macos-11
  73. strategy:
  74. matrix:
  75. target: [iOS]
  76. steps:
  77. - uses: actions/checkout@v2
  78. - uses: mikehardy/buildcache-action@50738c6c77de7f34e66b870e4f8ede333b69d077
  79. with:
  80. cache_key: ${{ matrix.os }}
  81. - name: Initialize xcodebuild
  82. run: scripts/setup_spm_tests.sh
  83. - name: Unit Tests
  84. run: scripts/third_party/travis/retry.sh ./scripts/build.sh PerformanceUnit ${{ matrix.target }} spm
  85. spm-cron:
  86. # Don't run on private repo.
  87. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  88. runs-on: macos-11
  89. strategy:
  90. matrix:
  91. target: [tvOS]
  92. steps:
  93. - uses: actions/checkout@v2
  94. - uses: mikehardy/buildcache-action@50738c6c77de7f34e66b870e4f8ede333b69d077
  95. with:
  96. cache_key: ${{ matrix.os }}
  97. - name: Initialize xcodebuild
  98. run: scripts/setup_spm_tests.sh
  99. - name: Unit Tests
  100. run: scripts/third_party/travis/retry.sh ./scripts/build.sh PerformanceUnit ${{ matrix.target }} spm
  101. catalyst:
  102. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  103. runs-on: macos-11
  104. steps:
  105. - uses: actions/checkout@v2
  106. - uses: mikehardy/buildcache-action@50738c6c77de7f34e66b870e4f8ede333b69d077
  107. with:
  108. cache_key: ${{ matrix.os }}
  109. - name: Setup Bundler
  110. run: scripts/setup_bundler.sh
  111. - name: Setup project and Build Catalyst
  112. run: scripts/test_catalyst.sh FirebasePerformance build
  113. podspec-presubmit:
  114. # Don't run on private repo unless it is a PR.
  115. if: github.repository == 'Firebase/firebase-ios-sdk' && github.event.pull_request.merged != true && github.event.action != 'closed'
  116. runs-on: macos-11
  117. steps:
  118. - uses: actions/checkout@v2
  119. - name: Setup Bundler
  120. run: scripts/setup_bundler.sh
  121. - name: Build and test
  122. run: scripts/third_party/travis/retry.sh pod spec lint FirebasePerformance.podspec --skip-tests --sources='https://github.com/firebase/SpecsTesting','https://github.com/firebase/SpecsDev.git','https://github.com/firebase/SpecsStaging.git','https://cdn.cocoapods.org/'
  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-11
  127. strategy:
  128. matrix:
  129. target: [ios, tvos]
  130. flags: [
  131. '--skip-tests --use-static-frameworks',
  132. '--skip-tests --use-libraries'
  133. ]
  134. needs: pod-lib-lint
  135. steps:
  136. - uses: actions/checkout@v2
  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 }}