abtesting.yml 5.7 KB

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