abtesting.yml 6.1 KB

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