inappmessaging.yml 5.4 KB

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