abtesting.yml 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. name: abtesting
  2. on:
  3. pull_request:
  4. paths:
  5. - 'FirebaseABTesting**'
  6. - 'Interop/Analytics/Public/*.h'
  7. - '.github/workflows/abtesting.yml'
  8. - 'Gemfile*'
  9. schedule:
  10. # Run every day at 1am(PST) - cron uses UTC times
  11. - cron: '0 9 * * *'
  12. concurrency:
  13. group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
  14. cancel-in-progress: true
  15. jobs:
  16. pod-lib-lint:
  17. # Don't run on private repo unless it is a PR.
  18. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  19. strategy:
  20. matrix:
  21. # TODO: macos tests are blocked by https://github.com/erikdoe/ocmock/pull/532
  22. target: [ios, tvos, macos --skip-tests, watchos]
  23. os: [macos-14]
  24. xcode: [Xcode_15.2, Xcode_16]
  25. runs-on: ${{ matrix.os }}
  26. steps:
  27. - uses: actions/checkout@v4
  28. - uses: ruby/setup-ruby@v1
  29. - name: Setup Bundler
  30. run: scripts/setup_bundler.sh
  31. - name: Xcode
  32. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  33. - uses: nick-fields/retry@v3
  34. with:
  35. timeout_minutes: 120
  36. max_attempts: 3
  37. retry_on: error
  38. retry_wait_seconds: 120
  39. command: scripts/pod_lib_lint.rb FirebaseABTesting.podspec --platforms=${{ matrix.target }}
  40. spm-package-resolved:
  41. env:
  42. FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
  43. runs-on: macos-14
  44. outputs:
  45. cache_key: ${{ steps.generate_cache_key.outputs.cache_key }}
  46. steps:
  47. - uses: actions/checkout@v4
  48. - name: Generate Swift Package.resolved
  49. id: swift_package_resolve
  50. run: |
  51. swift package resolve
  52. - name: Generate cache key
  53. id: generate_cache_key
  54. run: |
  55. cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}"
  56. echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT"
  57. - uses: actions/cache/save@v4
  58. id: cache
  59. with:
  60. path: .build
  61. key: ${{ steps.generate_cache_key.outputs.cache_key }}
  62. spm:
  63. # Don't run on private repo unless it is a PR.
  64. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  65. needs: [spm-package-resolved]
  66. strategy:
  67. matrix:
  68. target: [iOS, tvOS, macOS, catalyst, watchOS]
  69. os: [macos-14]
  70. xcode: [Xcode_15.2, Xcode_16]
  71. runs-on: ${{ matrix.os }}
  72. steps:
  73. - uses: actions/checkout@v4
  74. - uses: actions/cache/restore@v4
  75. with:
  76. path: .build
  77. key: ${{needs.spm-package-resolved.outputs.cache_key}}
  78. - name: Xcode
  79. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  80. - name: Initialize xcodebuild
  81. run: scripts/setup_spm_tests.sh
  82. - uses: nick-fields/retry@v3
  83. with:
  84. timeout_minutes: 120
  85. max_attempts: 3
  86. retry_on: error
  87. retry_wait_seconds: 120
  88. command: scripts/build.sh ABTestingUnit ${{ matrix.target }} spm
  89. catalyst:
  90. # Don't run on private repo unless it is a PR.
  91. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  92. runs-on: macos-14
  93. steps:
  94. - uses: actions/checkout@v4
  95. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  96. with:
  97. cache_key: catalyst${{ matrix.os }}
  98. - uses: ruby/setup-ruby@v1
  99. - name: Setup Bundler
  100. run: scripts/setup_bundler.sh
  101. - uses: nick-fields/retry@v3
  102. with:
  103. timeout_minutes: 120
  104. max_attempts: 3
  105. retry_on: error
  106. retry_wait_seconds: 120
  107. command: scripts/test_catalyst.sh FirebaseABTesting test FirebaseABTesting-Unit-unit
  108. quickstart:
  109. # Don't run on private repo unless it is a PR.
  110. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  111. env:
  112. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  113. signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  114. runs-on: macos-14
  115. steps:
  116. - uses: actions/checkout@v4
  117. - uses: ruby/setup-ruby@v1
  118. - name: Setup quickstart
  119. env:
  120. LEGACY: true
  121. run: scripts/setup_quickstart.sh abtesting
  122. - name: Install Secret GoogleService-Info.plist
  123. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-abtesting.plist.gpg \
  124. quickstart-ios/abtesting/GoogleService-Info.plist "$plist_secret"
  125. - name: Test swift quickstart
  126. env:
  127. LEGACY: true
  128. run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh ABTesting true)
  129. quickstart-ftl-cron-only:
  130. # Don't run on private repo.
  131. if: github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule'
  132. env:
  133. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  134. signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  135. runs-on: macos-14
  136. steps:
  137. - uses: actions/checkout@v4
  138. - uses: ruby/setup-ruby@v1
  139. - uses: actions/setup-python@v5
  140. with:
  141. python-version: '3.11'
  142. - name: Setup quickstart
  143. env:
  144. LEGACY: true
  145. run: scripts/setup_quickstart.sh abtesting
  146. - name: Install Secret GoogleService-Info.plist
  147. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-abtesting.plist.gpg \
  148. quickstart-ios/abtesting/GoogleService-Info.plist "$plist_secret"
  149. - name: Build swift quickstart
  150. env:
  151. LEGACY: true
  152. run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart_ftl.sh ABTesting)
  153. - id: ftl_test
  154. uses: FirebaseExtended/github-actions/firebase-test-lab@v1.4
  155. with:
  156. credentials_json: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CREDENTIALS }}
  157. testapp_dir: quickstart-ios/build-for-testing
  158. test_type: "xctest"
  159. abtesting-cron-only:
  160. # Don't run on private repo.
  161. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  162. runs-on: macos-14
  163. strategy:
  164. matrix:
  165. target: [ios, tvos, macos]
  166. flags: [
  167. '--use-static-frameworks'
  168. ]
  169. needs: pod-lib-lint
  170. steps:
  171. - uses: actions/checkout@v4
  172. - uses: ruby/setup-ruby@v1
  173. - name: Setup Bundler
  174. run: scripts/setup_bundler.sh
  175. - name: PodLibLint ABTesting Cron
  176. run: |
  177. scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb \
  178. FirebaseABTesting.podspec --platforms=${{ matrix.target }} ${{ matrix.flags }}