abtesting.yml 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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. runs-on: macos-12
  20. strategy:
  21. matrix:
  22. target: [ios, tvos, macos, watchos]
  23. steps:
  24. - uses: actions/checkout@v3
  25. - uses: ruby/setup-ruby@v1
  26. - name: Setup Bundler
  27. run: scripts/setup_bundler.sh
  28. - name: Build and test
  29. run: |
  30. scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseABTesting.podspec \
  31. --platforms=${{ matrix.target }}
  32. spm:
  33. # Don't run on private repo unless it is a PR.
  34. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  35. runs-on: macos-12
  36. strategy:
  37. matrix:
  38. target: [iOS, tvOS, macOS, catalyst, watchOS]
  39. steps:
  40. - uses: actions/checkout@v3
  41. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  42. with:
  43. cache_key: ${{ matrix.os }}
  44. - name: Initialize xcodebuild
  45. run: scripts/setup_spm_tests.sh
  46. - name: Unit Tests
  47. run: scripts/third_party/travis/retry.sh ./scripts/build.sh ABTestingUnit ${{ matrix.target }} spm
  48. catalyst:
  49. # Don't run on private repo unless it is a PR.
  50. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  51. runs-on: macos-12
  52. steps:
  53. - uses: actions/checkout@v3
  54. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  55. with:
  56. cache_key: ${{ matrix.os }}
  57. - uses: ruby/setup-ruby@v1
  58. - name: Setup Bundler
  59. run: scripts/setup_bundler.sh
  60. - name: Setup project and Build for Catalyst
  61. run: scripts/test_catalyst.sh FirebaseABTesting test FirebaseABTesting-Unit-unit
  62. quickstart:
  63. # Don't run on private repo unless it is a PR.
  64. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  65. env:
  66. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  67. signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  68. runs-on: macos-12
  69. steps:
  70. - uses: actions/checkout@v3
  71. - uses: ruby/setup-ruby@v1
  72. - name: Setup quickstart
  73. env:
  74. LEGACY: true
  75. run: scripts/setup_quickstart.sh abtesting
  76. - name: Install Secret GoogleService-Info.plist
  77. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-abtesting.plist.gpg \
  78. quickstart-ios/abtesting/GoogleService-Info.plist "$plist_secret"
  79. - name: Test swift quickstart
  80. env:
  81. LEGACY: true
  82. run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh ABTesting true)
  83. quickstart-ftl-cron-only:
  84. # Don't run on private repo.
  85. if: github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule'
  86. env:
  87. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  88. signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  89. runs-on: macos-12
  90. steps:
  91. - uses: actions/checkout@v3
  92. - uses: ruby/setup-ruby@v1
  93. - name: Setup quickstart
  94. env:
  95. LEGACY: true
  96. run: scripts/setup_quickstart.sh abtesting
  97. - name: Install Secret GoogleService-Info.plist
  98. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-abtesting.plist.gpg \
  99. quickstart-ios/abtesting/GoogleService-Info.plist "$plist_secret"
  100. - name: Build swift quickstart
  101. env:
  102. LEGACY: true
  103. run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart_ftl.sh ABTesting)
  104. - id: ftl_test
  105. uses: FirebaseExtended/github-actions/firebase-test-lab@v1.2
  106. with:
  107. credentials_json: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CREDENTIALS }}
  108. testapp_dir: quickstart-ios/build-for-testing
  109. test_type: "xctest"
  110. abtesting-cron-only:
  111. # Don't run on private repo.
  112. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  113. runs-on: macos-12
  114. strategy:
  115. matrix:
  116. target: [ios, tvos, macos]
  117. flags: [
  118. '--use-static-frameworks'
  119. ]
  120. needs: pod-lib-lint
  121. steps:
  122. - uses: actions/checkout@v3
  123. - uses: ruby/setup-ruby@v1
  124. - name: Setup Bundler
  125. run: scripts/setup_bundler.sh
  126. - name: PodLibLint ABTesting Cron
  127. run: |
  128. scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb \
  129. FirebaseABTesting.podspec --platforms=${{ matrix.target }} ${{ matrix.flags }}