inappmessaging.yml 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. name: inappmessaging
  2. on:
  3. workflow_dispatch:
  4. pull_request:
  5. paths:
  6. - 'FirebaseInAppMessaging**'
  7. - 'Interop/Analytics/Public/*.h'
  8. - '.github/workflows/inappmessaging.yml'
  9. - 'Gemfile*'
  10. schedule:
  11. # Run every day at 10pm (PST) - cron uses UTC times
  12. - cron: '0 6 * * *'
  13. concurrency:
  14. group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
  15. cancel-in-progress: true
  16. jobs:
  17. pod_lib_lint:
  18. # Don't run on private repo unless it is a PR.
  19. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  20. strategy:
  21. matrix:
  22. podspec: [FirebaseInAppMessaging.podspec]
  23. build-env:
  24. - os: macos-14
  25. xcode: Xcode_16.2
  26. - os: macos-15
  27. xcode: Xcode_16.2
  28. runs-on: ${{ matrix.build-env.os }}
  29. steps:
  30. - uses: actions/checkout@v4
  31. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  32. - name: Xcode
  33. run: sudo xcode-select -s /Applications/${{ matrix.build-env.xcode }}.app/Contents/Developer
  34. - name: Setup Bundler
  35. run: scripts/setup_bundler.sh
  36. - name: FirebaseInAppMessaging
  37. run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb ${{ matrix.podspec}}
  38. tests:
  39. # Don't run on private repo unless it is a PR.
  40. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  41. # TODO(#12770): Update to macos-14 when tests are updated for Xcode 15.
  42. runs-on: macos-15
  43. strategy:
  44. matrix:
  45. # TODO(#8682): Reenable iPad after fixing Xcode 13 test failures.
  46. # platform: [iOS, iPad]
  47. platform: [iOS]
  48. xcode: [Xcode_16.2]
  49. steps:
  50. - uses: actions/checkout@v4
  51. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  52. with:
  53. cache_key: ${{ matrix.platform }}
  54. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  55. - name: Setup Bundler
  56. run: scripts/setup_bundler.sh
  57. - name: Xcode
  58. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  59. - name: Prereqs
  60. run: scripts/install_prereqs.sh InAppMessaging ${{ matrix.platform }} xcodebuild
  61. - name: Build and test
  62. run: scripts/third_party/travis/retry.sh scripts/build.sh InAppMessaging ${{ matrix.platform }} xcodebuild
  63. spm-package-resolved:
  64. env:
  65. FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
  66. runs-on: macos-14
  67. outputs:
  68. cache_key: ${{ steps.generate_cache_key.outputs.cache_key }}
  69. steps:
  70. - uses: actions/checkout@v4
  71. - name: Xcode
  72. run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
  73. - name: Generate Swift Package.resolved
  74. id: swift_package_resolve
  75. run: |
  76. swift package resolve
  77. - name: Generate cache key
  78. id: generate_cache_key
  79. run: |
  80. cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}"
  81. echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT"
  82. - uses: actions/cache/save@v4
  83. id: cache
  84. with:
  85. path: .build
  86. key: ${{ steps.generate_cache_key.outputs.cache_key }}
  87. spm:
  88. # Don't run on private repo unless it is a PR.
  89. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  90. needs: [spm-package-resolved]
  91. strategy:
  92. matrix:
  93. include:
  94. - os: macos-14
  95. xcode: Xcode_16.2
  96. - os: macos-15
  97. xcode: Xcode_16.2
  98. runs-on: ${{ matrix.os }}
  99. steps:
  100. - uses: actions/checkout@v4
  101. - uses: actions/cache/restore@v4
  102. with:
  103. path: .build
  104. key: ${{needs.spm-package-resolved.outputs.cache_key}}
  105. - name: Xcode
  106. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  107. - name: Initialize xcodebuild
  108. run: scripts/setup_spm_tests.sh
  109. - name: iOS Unit Tests
  110. run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseInAppMessaging-Beta iOS spmbuildonly
  111. fiam-cron-only:
  112. # Don't run on private repo.
  113. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  114. runs-on: macos-15
  115. strategy:
  116. matrix:
  117. flags: [
  118. '--use-static-frameworks'
  119. ]
  120. platform: [ios, tvos]
  121. needs: pod_lib_lint
  122. steps:
  123. - uses: actions/checkout@v4
  124. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  125. - name: Xcode
  126. run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
  127. - name: Setup Bundler
  128. run: scripts/setup_bundler.sh
  129. - name: PodLibLint InAppMessaging Cron
  130. run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseInAppMessaging.podspec --platforms=${{ matrix.platform }} ${{ matrix.flags }}
  131. quickstart:
  132. # Don't run on private repo unless it is a PR.
  133. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  134. env:
  135. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  136. signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  137. runs-on: macos-15
  138. steps:
  139. - uses: actions/checkout@v4
  140. - uses: actions/checkout@v4
  141. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  142. - name: Xcode
  143. run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
  144. - name: Setup quickstart
  145. run: scripts/setup_quickstart.sh inappmessaging
  146. - name: install secret googleservice-info.plist
  147. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-inappmessaging.plist.gpg \
  148. quickstart-ios/inappmessaging/GoogleService-Info.plist "$plist_secret"
  149. - name: Test objc quickstart
  150. run: ([ -z $plist_secret ] ||
  151. scripts/third_party/travis/retry.sh scripts/test_quickstart.sh InAppMessaging true)
  152. - name: Test swift quickstart
  153. run: ([ -z $plist_secret ] ||
  154. scripts/third_party/travis/retry.sh scripts/test_quickstart.sh InAppMessaging true swift)