inappmessaging.yml 5.6 KB

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