abtesting.yml 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. name: abtesting
  2. on:
  3. workflow_dispatch:
  4. pull_request:
  5. paths:
  6. - 'FirebaseABTesting**'
  7. - 'Interop/Analytics/Public/*.h'
  8. - '.github/workflows/abtesting.yml'
  9. - 'Gemfile*'
  10. schedule:
  11. # Run every day at 1am(PST) - cron uses UTC times
  12. - cron: '0 9 * * *'
  13. concurrency:
  14. group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
  15. cancel-in-progress: true
  16. jobs:
  17. pod-lib-lint:
  18. # Don't run on private repo unless it is a PR.
  19. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  20. strategy:
  21. matrix:
  22. include:
  23. - os: macos-14
  24. xcode: Xcode_16.2
  25. target: ios
  26. - os: macos-15
  27. xcode: Xcode_16.2
  28. target: ios
  29. - os: macos-15
  30. xcode: Xcode_16.2
  31. target: tvos
  32. - os: macos-15
  33. xcode: Xcode_16.2
  34. target: macos
  35. - os: macos-15
  36. xcode: Xcode_16.2
  37. target: watchos
  38. runs-on: ${{ matrix.os }}
  39. steps:
  40. - uses: actions/checkout@v4
  41. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  42. - name: Setup Bundler
  43. run: scripts/setup_bundler.sh
  44. - name: Xcode
  45. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  46. - uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3
  47. with:
  48. timeout_minutes: 120
  49. max_attempts: 3
  50. retry_on: error
  51. retry_wait_seconds: 120
  52. command: scripts/pod_lib_lint.rb FirebaseABTesting.podspec --platforms=${{ matrix.target }}
  53. spm-package-resolved:
  54. env:
  55. FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
  56. runs-on: macos-15
  57. outputs:
  58. cache_key: ${{ steps.generate_cache_key.outputs.cache_key }}
  59. steps:
  60. - uses: actions/checkout@v4
  61. - name: Xcode
  62. run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
  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-14
  85. xcode: Xcode_16.2
  86. target: iOS
  87. - os: macos-15
  88. xcode: Xcode_16.2
  89. target: iOS
  90. - os: macos-15
  91. xcode: Xcode_16.2
  92. target: tvOS
  93. - os: macos-15
  94. xcode: Xcode_16.2
  95. target: macOS
  96. - os: macos-15
  97. xcode: Xcode_16.2
  98. target: watchOS
  99. - os: macos-15
  100. xcode: Xcode_16.2
  101. target: catalyst
  102. - os: macos-15
  103. xcode: Xcode_16.2
  104. target: visionOS
  105. runs-on: ${{ matrix.os }}
  106. steps:
  107. - uses: actions/checkout@v4
  108. - uses: actions/cache/restore@v4
  109. with:
  110. path: .build
  111. key: ${{needs.spm-package-resolved.outputs.cache_key}}
  112. - name: Xcode
  113. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  114. - name: Install visionOS, if needed.
  115. if: matrix.target == 'visionOS'
  116. run: xcodebuild -downloadPlatform visionOS
  117. - name: Initialize xcodebuild
  118. run: scripts/setup_spm_tests.sh
  119. - uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # 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-15
  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@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  136. - name: Setup Bundler
  137. run: scripts/setup_bundler.sh
  138. - name: Xcode
  139. run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
  140. - uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3
  141. with:
  142. timeout_minutes: 120
  143. max_attempts: 3
  144. retry_on: error
  145. retry_wait_seconds: 120
  146. command: scripts/test_catalyst.sh FirebaseABTesting test FirebaseABTesting-Unit-unit
  147. quickstart:
  148. # Don't run on private repo unless it is a PR.
  149. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  150. env:
  151. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  152. signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  153. runs-on: macos-15
  154. steps:
  155. - uses: actions/checkout@v4
  156. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  157. - name: Xcode
  158. run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
  159. - name: Setup quickstart
  160. env:
  161. LEGACY: true
  162. run: scripts/setup_quickstart.sh abtesting
  163. - name: Install Secret GoogleService-Info.plist
  164. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-abtesting.plist.gpg \
  165. quickstart-ios/abtesting/GoogleService-Info.plist "$plist_secret"
  166. - name: Test swift quickstart
  167. env:
  168. LEGACY: true
  169. run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh ABTesting true)
  170. quickstart-ftl-cron-only:
  171. # Don't run on private repo.
  172. if: github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule'
  173. env:
  174. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  175. signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  176. runs-on: macos-15
  177. steps:
  178. - uses: actions/checkout@v4
  179. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  180. - uses: actions/setup-python@v5
  181. with:
  182. python-version: '3.11'
  183. - name: Setup quickstart
  184. env:
  185. LEGACY: true
  186. run: scripts/setup_quickstart.sh abtesting
  187. - name: Install Secret GoogleService-Info.plist
  188. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-abtesting.plist.gpg \
  189. quickstart-ios/abtesting/GoogleService-Info.plist "$plist_secret"
  190. - name: Xcode
  191. run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
  192. - name: Build swift quickstart
  193. env:
  194. LEGACY: true
  195. run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart_ftl.sh ABTesting)
  196. - id: ftl_test
  197. uses: FirebaseExtended/github-actions/firebase-test-lab@v1.4
  198. with:
  199. credentials_json: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CREDENTIALS }}
  200. testapp_dir: quickstart-ios/build-for-testing
  201. test_type: "xctest"
  202. abtesting-cron-only:
  203. # Don't run on private repo.
  204. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  205. runs-on: macos-15
  206. strategy:
  207. matrix:
  208. target: [ios, tvos, macos]
  209. flags: [
  210. '--use-static-frameworks'
  211. ]
  212. needs: pod-lib-lint
  213. steps:
  214. - uses: actions/checkout@v4
  215. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  216. - name: Setup Bundler
  217. run: scripts/setup_bundler.sh
  218. - name: Xcode
  219. run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
  220. - name: PodLibLint ABTesting Cron
  221. run: |
  222. scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb \
  223. FirebaseABTesting.podspec --platforms=${{ matrix.target }} ${{ matrix.flags }}