inappmessaging.yml 6.1 KB

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