abtesting.yml 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  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. include:
  22. - os: macos-13
  23. xcode: Xcode_15.2
  24. target: ios
  25. - os: macos-14
  26. xcode: Xcode_15.4
  27. target: ios
  28. - os: macos-15
  29. xcode: Xcode_16
  30. target: ios
  31. - os: macos-15
  32. xcode: Xcode_16
  33. target: tvos
  34. - os: macos-15
  35. xcode: Xcode_16
  36. target: macos
  37. - os: macos-15
  38. xcode: Xcode_16
  39. target: watchos
  40. runs-on: ${{ matrix.os }}
  41. steps:
  42. - uses: actions/checkout@v4
  43. - uses: ruby/setup-ruby@v1
  44. - name: Setup Bundler
  45. run: scripts/setup_bundler.sh
  46. - name: Xcode
  47. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  48. - uses: nick-fields/retry@v3
  49. with:
  50. timeout_minutes: 120
  51. max_attempts: 3
  52. retry_on: error
  53. retry_wait_seconds: 120
  54. command: scripts/pod_lib_lint.rb FirebaseABTesting.podspec --platforms=${{ matrix.target }}
  55. spm-package-resolved:
  56. env:
  57. FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
  58. runs-on: macos-14
  59. outputs:
  60. cache_key: ${{ steps.generate_cache_key.outputs.cache_key }}
  61. steps:
  62. - uses: actions/checkout@v4
  63. - name: Generate Swift Package.resolved
  64. id: swift_package_resolve
  65. run: |
  66. swift package resolve
  67. - name: Generate cache key
  68. id: generate_cache_key
  69. run: |
  70. cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}"
  71. echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT"
  72. - uses: actions/cache/save@v4
  73. id: cache
  74. with:
  75. path: .build
  76. key: ${{ steps.generate_cache_key.outputs.cache_key }}
  77. spm:
  78. # Don't run on private repo unless it is a PR.
  79. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  80. needs: [spm-package-resolved]
  81. strategy:
  82. matrix:
  83. include:
  84. - os: macos-13
  85. xcode: Xcode_15.2
  86. target: iOS
  87. - os: macos-14
  88. xcode: Xcode_15.4
  89. target: iOS
  90. - os: macos-15
  91. xcode: Xcode_16
  92. target: iOS
  93. - os: macos-15
  94. xcode: Xcode_16
  95. target: tvOS
  96. - os: macos-15
  97. xcode: Xcode_16
  98. target: macOS
  99. - os: macos-15
  100. xcode: Xcode_16
  101. target: watchOS
  102. - os: macos-15
  103. xcode: Xcode_16
  104. target: catalyst
  105. - os: macos-15
  106. xcode: Xcode_16
  107. target: visionOS
  108. runs-on: ${{ matrix.os }}
  109. steps:
  110. - uses: actions/checkout@v4
  111. - uses: actions/cache/restore@v4
  112. with:
  113. path: .build
  114. key: ${{needs.spm-package-resolved.outputs.cache_key}}
  115. - name: Xcode
  116. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  117. - name: Initialize xcodebuild
  118. run: scripts/setup_spm_tests.sh
  119. - uses: nick-fields/retry@v3
  120. with:
  121. timeout_minutes: 120
  122. max_attempts: 3
  123. retry_on: error
  124. retry_wait_seconds: 120
  125. command: scripts/build.sh ABTestingUnit ${{ matrix.target }} spm
  126. catalyst:
  127. # Don't run on private repo unless it is a PR.
  128. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  129. runs-on: macos-14
  130. steps:
  131. - uses: actions/checkout@v4
  132. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  133. with:
  134. cache_key: catalyst${{ matrix.os }}
  135. - uses: ruby/setup-ruby@v1
  136. - name: Setup Bundler
  137. run: scripts/setup_bundler.sh
  138. - uses: nick-fields/retry@v3
  139. with:
  140. timeout_minutes: 120
  141. max_attempts: 3
  142. retry_on: error
  143. retry_wait_seconds: 120
  144. command: scripts/test_catalyst.sh FirebaseABTesting test FirebaseABTesting-Unit-unit
  145. quickstart:
  146. # Don't run on private repo unless it is a PR.
  147. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  148. env:
  149. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  150. signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  151. runs-on: macos-14
  152. steps:
  153. - uses: actions/checkout@v4
  154. - uses: ruby/setup-ruby@v1
  155. - name: Setup quickstart
  156. env:
  157. LEGACY: true
  158. run: scripts/setup_quickstart.sh abtesting
  159. - name: Install Secret GoogleService-Info.plist
  160. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-abtesting.plist.gpg \
  161. quickstart-ios/abtesting/GoogleService-Info.plist "$plist_secret"
  162. - name: Test swift quickstart
  163. env:
  164. LEGACY: true
  165. run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh ABTesting true)
  166. quickstart-ftl-cron-only:
  167. # Don't run on private repo.
  168. if: github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule'
  169. env:
  170. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  171. signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  172. runs-on: macos-14
  173. steps:
  174. - uses: actions/checkout@v4
  175. - uses: ruby/setup-ruby@v1
  176. - uses: actions/setup-python@v5
  177. with:
  178. python-version: '3.11'
  179. - name: Setup quickstart
  180. env:
  181. LEGACY: true
  182. run: scripts/setup_quickstart.sh abtesting
  183. - name: Install Secret GoogleService-Info.plist
  184. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-abtesting.plist.gpg \
  185. quickstart-ios/abtesting/GoogleService-Info.plist "$plist_secret"
  186. - name: Build swift quickstart
  187. env:
  188. LEGACY: true
  189. run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart_ftl.sh ABTesting)
  190. - id: ftl_test
  191. uses: FirebaseExtended/github-actions/firebase-test-lab@v1.4
  192. with:
  193. credentials_json: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CREDENTIALS }}
  194. testapp_dir: quickstart-ios/build-for-testing
  195. test_type: "xctest"
  196. abtesting-cron-only:
  197. # Don't run on private repo.
  198. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  199. runs-on: macos-14
  200. strategy:
  201. matrix:
  202. target: [ios, tvos, macos]
  203. flags: [
  204. '--use-static-frameworks'
  205. ]
  206. needs: pod-lib-lint
  207. steps:
  208. - uses: actions/checkout@v4
  209. - uses: ruby/setup-ruby@v1
  210. - name: Setup Bundler
  211. run: scripts/setup_bundler.sh
  212. - name: PodLibLint ABTesting Cron
  213. run: |
  214. scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb \
  215. FirebaseABTesting.podspec --platforms=${{ matrix.target }} ${{ matrix.flags }}