abtesting.yml 5.9 KB

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