abtesting.yml 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  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.2
  30. target: ios
  31. - os: macos-15
  32. xcode: Xcode_16.2
  33. target: tvos
  34. - os: macos-15
  35. xcode: Xcode_16.2
  36. target: macos
  37. - os: macos-15
  38. xcode: Xcode_16.2
  39. target: watchos
  40. runs-on: ${{ matrix.os }}
  41. steps:
  42. - uses: actions/checkout@v4
  43. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # 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@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # 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.2
  92. target: iOS
  93. - os: macos-15
  94. xcode: Xcode_16.2
  95. target: tvOS
  96. - os: macos-15
  97. xcode: Xcode_16.2
  98. target: macOS
  99. - os: macos-15
  100. xcode: Xcode_16.2
  101. target: watchOS
  102. - os: macos-15
  103. xcode: Xcode_16.2
  104. target: catalyst
  105. - os: macos-15
  106. xcode: Xcode_16.2
  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: Install visionOS, if needed.
  118. if: matrix.target == 'visionOS'
  119. run: xcodebuild -downloadPlatform visionOS
  120. - name: Initialize xcodebuild
  121. run: scripts/setup_spm_tests.sh
  122. - uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3
  123. with:
  124. timeout_minutes: 120
  125. max_attempts: 3
  126. retry_on: error
  127. retry_wait_seconds: 120
  128. command: scripts/build.sh ABTestingUnit ${{ matrix.target }} spm
  129. catalyst:
  130. # Don't run on private repo unless it is a PR.
  131. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  132. runs-on: macos-15
  133. steps:
  134. - uses: actions/checkout@v4
  135. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  136. with:
  137. cache_key: catalyst${{ matrix.os }}
  138. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  139. - name: Setup Bundler
  140. run: scripts/setup_bundler.sh
  141. - name: Xcode
  142. run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
  143. - uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3
  144. with:
  145. timeout_minutes: 120
  146. max_attempts: 3
  147. retry_on: error
  148. retry_wait_seconds: 120
  149. command: scripts/test_catalyst.sh FirebaseABTesting test FirebaseABTesting-Unit-unit
  150. quickstart:
  151. # Don't run on private repo unless it is a PR.
  152. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  153. env:
  154. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  155. signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  156. runs-on: macos-14
  157. steps:
  158. - uses: actions/checkout@v4
  159. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  160. - name: Setup quickstart
  161. env:
  162. LEGACY: true
  163. run: scripts/setup_quickstart.sh abtesting
  164. - name: Install Secret GoogleService-Info.plist
  165. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-abtesting.plist.gpg \
  166. quickstart-ios/abtesting/GoogleService-Info.plist "$plist_secret"
  167. - name: Test swift quickstart
  168. env:
  169. LEGACY: true
  170. run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh ABTesting true)
  171. quickstart-ftl-cron-only:
  172. # Don't run on private repo.
  173. if: github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule'
  174. env:
  175. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  176. signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  177. runs-on: macos-14
  178. steps:
  179. - uses: actions/checkout@v4
  180. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  181. - uses: actions/setup-python@v5
  182. with:
  183. python-version: '3.11'
  184. - name: Setup quickstart
  185. env:
  186. LEGACY: true
  187. run: scripts/setup_quickstart.sh abtesting
  188. - name: Install Secret GoogleService-Info.plist
  189. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-abtesting.plist.gpg \
  190. quickstart-ios/abtesting/GoogleService-Info.plist "$plist_secret"
  191. - name: Build swift quickstart
  192. env:
  193. LEGACY: true
  194. run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart_ftl.sh ABTesting)
  195. - id: ftl_test
  196. uses: FirebaseExtended/github-actions/firebase-test-lab@v1.4
  197. with:
  198. credentials_json: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CREDENTIALS }}
  199. testapp_dir: quickstart-ios/build-for-testing
  200. test_type: "xctest"
  201. abtesting-cron-only:
  202. # Don't run on private repo.
  203. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  204. runs-on: macos-14
  205. strategy:
  206. matrix:
  207. target: [ios, tvos, macos]
  208. flags: [
  209. '--use-static-frameworks'
  210. ]
  211. needs: pod-lib-lint
  212. steps:
  213. - uses: actions/checkout@v4
  214. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  215. - name: Setup Bundler
  216. run: scripts/setup_bundler.sh
  217. - name: PodLibLint ABTesting Cron
  218. run: |
  219. scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb \
  220. FirebaseABTesting.podspec --platforms=${{ matrix.target }} ${{ matrix.flags }}