performance.yml 5.3 KB

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