abtesting.yml 6.1 KB

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