abtesting.yml 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  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@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.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@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-14
  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@v1
  139. - name: Setup Bundler
  140. run: scripts/setup_bundler.sh
  141. - uses: nick-fields/retry@v3
  142. with:
  143. timeout_minutes: 120
  144. max_attempts: 3
  145. retry_on: error
  146. retry_wait_seconds: 120
  147. command: scripts/test_catalyst.sh FirebaseABTesting test FirebaseABTesting-Unit-unit
  148. quickstart:
  149. # Don't run on private repo unless it is a PR.
  150. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  151. env:
  152. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  153. signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  154. runs-on: macos-14
  155. steps:
  156. - uses: actions/checkout@v4
  157. - uses: ruby/setup-ruby@v1
  158. - name: Setup quickstart
  159. env:
  160. LEGACY: true
  161. run: scripts/setup_quickstart.sh abtesting
  162. - name: Install Secret GoogleService-Info.plist
  163. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-abtesting.plist.gpg \
  164. quickstart-ios/abtesting/GoogleService-Info.plist "$plist_secret"
  165. - name: Test swift quickstart
  166. env:
  167. LEGACY: true
  168. run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh ABTesting true)
  169. quickstart-ftl-cron-only:
  170. # Don't run on private repo.
  171. if: github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule'
  172. env:
  173. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  174. signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  175. runs-on: macos-14
  176. steps:
  177. - uses: actions/checkout@v4
  178. - uses: ruby/setup-ruby@v1
  179. - uses: actions/setup-python@v5
  180. with:
  181. python-version: '3.11'
  182. - name: Setup quickstart
  183. env:
  184. LEGACY: true
  185. run: scripts/setup_quickstart.sh abtesting
  186. - name: Install Secret GoogleService-Info.plist
  187. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-abtesting.plist.gpg \
  188. quickstart-ios/abtesting/GoogleService-Info.plist "$plist_secret"
  189. - name: Build swift quickstart
  190. env:
  191. LEGACY: true
  192. run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart_ftl.sh ABTesting)
  193. - id: ftl_test
  194. uses: FirebaseExtended/github-actions/firebase-test-lab@v1.4
  195. with:
  196. credentials_json: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CREDENTIALS }}
  197. testapp_dir: quickstart-ios/build-for-testing
  198. test_type: "xctest"
  199. abtesting-cron-only:
  200. # Don't run on private repo.
  201. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  202. runs-on: macos-14
  203. strategy:
  204. matrix:
  205. target: [ios, tvos, macos]
  206. flags: [
  207. '--use-static-frameworks'
  208. ]
  209. needs: pod-lib-lint
  210. steps:
  211. - uses: actions/checkout@v4
  212. - uses: ruby/setup-ruby@v1
  213. - name: Setup Bundler
  214. run: scripts/setup_bundler.sh
  215. - name: PodLibLint ABTesting Cron
  216. run: |
  217. scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb \
  218. FirebaseABTesting.podspec --platforms=${{ matrix.target }} ${{ matrix.flags }}