installations.yml 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. name: installations
  2. on:
  3. pull_request:
  4. paths:
  5. - 'FirebaseInstallations**'
  6. - '.github/workflows/installations.yml'
  7. - 'Gemfile*'
  8. schedule:
  9. # Run every day at 10pm (PST) - cron uses UTC times
  10. - cron: '0 6 * * *'
  11. concurrency:
  12. group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
  13. cancel-in-progress: true
  14. jobs:
  15. pod-lib-lint:
  16. # Don't run on private repo unless it is a PR.
  17. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  18. env:
  19. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  20. strategy:
  21. matrix:
  22. # TODO: macos tests are blocked by https://github.com/erikdoe/ocmock/pull/532
  23. target: [ios, tvos, macos --skip-tests, watchos]
  24. os: [macos-14]
  25. include:
  26. - os: macos-14
  27. xcode: Xcode_15.3
  28. test-specs: unit,integration
  29. - os: macos-14
  30. xcode: Xcode_16
  31. test-specs: unit
  32. runs-on: ${{ matrix.os }}
  33. steps:
  34. - uses: actions/checkout@v4
  35. - uses: ruby/setup-ruby@v1
  36. - name: Setup Bundler
  37. run: scripts/setup_bundler.sh
  38. - name: Configure test keychain
  39. run: scripts/configure_test_keychain.sh
  40. - name: Install GoogleService-Info.plist
  41. run: |
  42. mkdir -p FirebaseInstallations/Source/Tests/Resources
  43. scripts/decrypt_gha_secret.sh scripts/gha-encrypted/Installations/GoogleService-Info.plist.gpg \
  44. FirebaseInstallations/Source/Tests/Resources/GoogleService-Info.plist "$plist_secret"
  45. - name: Get boolean for secrets available
  46. id: secrets
  47. run: echo "::set-output name=val::$([[ -z $plist_secret ]] && echo "0" || echo "1")"
  48. - name: Xcode
  49. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  50. - name: Build and test
  51. run: |
  52. export FIS_INTEGRATION_TESTS_REQUIRED=${{ steps.secrets.outputs.val }}
  53. scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseInstallations.podspec \
  54. --platforms=${{ matrix.target }} --test-specs=${{ matrix.test-specs }}
  55. spm-package-resolved:
  56. env:
  57. FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
  58. runs-on: macos-14
  59. outputs:
  60. cache_key: ${{ steps.generate_cache_key.outputs.cache_key }}
  61. steps:
  62. - uses: actions/checkout@v4
  63. - name: Generate Swift Package.resolved
  64. id: swift_package_resolve
  65. run: |
  66. swift package resolve
  67. - name: Generate cache key
  68. id: generate_cache_key
  69. run: |
  70. cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}"
  71. echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT"
  72. - uses: actions/cache/save@v4
  73. id: cache
  74. with:
  75. path: .build
  76. key: ${{ steps.generate_cache_key.outputs.cache_key }}
  77. spm:
  78. # Don't run on private repo unless it is a PR.
  79. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  80. needs: [spm-package-resolved]
  81. strategy:
  82. matrix:
  83. include:
  84. - os: macos-13
  85. xcode: Xcode_15.2
  86. target: iOS
  87. - os: macos-14
  88. xcode: Xcode_15.4
  89. target: iOS
  90. - os: macos-15
  91. xcode: Xcode_16
  92. target: iOS
  93. - os: macos-15
  94. xcode: Xcode_16
  95. target: tvOS
  96. - os: macos-15
  97. xcode: Xcode_16
  98. target: macOS
  99. - os: macos-15
  100. xcode: Xcode_16
  101. target: watchOS
  102. - os: macos-15
  103. xcode: Xcode_16
  104. target: catalyst
  105. - os: macos-15
  106. xcode: Xcode_16
  107. target: visionOS
  108. runs-on: ${{ matrix.os }}
  109. steps:
  110. - uses: actions/checkout@v4
  111. - uses: actions/cache/restore@v4
  112. with:
  113. path: .build
  114. key: ${{needs.spm-package-resolved.outputs.cache_key}}
  115. - name: Xcode
  116. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  117. - name: Initialize xcodebuild
  118. run: scripts/setup_spm_tests.sh
  119. - name: Unit Tests
  120. run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseInstallations ${{ matrix.target }} spmbuildonly
  121. catalyst:
  122. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  123. runs-on: macos-14
  124. steps:
  125. - uses: actions/checkout@v4
  126. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  127. with:
  128. cache_key: catalyst${{ matrix.os }}
  129. - uses: ruby/setup-ruby@v1
  130. - name: Setup Bundler
  131. run: scripts/setup_bundler.sh
  132. - name: Setup project and Build for Catalyst
  133. run: scripts/test_catalyst.sh FirebaseInstallations test FirebaseInstallations-Unit-unit
  134. quickstart:
  135. # Don't run on private repo unless it is a PR.
  136. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  137. runs-on: macos-14
  138. steps:
  139. - uses: actions/checkout@v4
  140. - uses: ruby/setup-ruby@v1
  141. - name: Setup quickstart
  142. run: scripts/setup_quickstart.sh installations
  143. - name: Copy mock plist
  144. run: cp quickstart-ios/mock-GoogleService-Info.plist quickstart-ios/installations/GoogleService-Info.plist
  145. - name: Test objc quickstart
  146. run: scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Installations true
  147. - name: Test swift quickstart
  148. run: scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Installations true swift
  149. quickstart-ftl-cron-only:
  150. # Don't run on private repo.
  151. if: github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule'
  152. runs-on: macos-14
  153. steps:
  154. - uses: actions/checkout@v4
  155. - uses: ruby/setup-ruby@v1
  156. - uses: actions/setup-python@v5
  157. with:
  158. python-version: '3.11'
  159. - name: Setup quickstart
  160. run: scripts/setup_quickstart.sh installations
  161. - name: Copy mock plist
  162. run: cp quickstart-ios/mock-GoogleService-Info.plist quickstart-ios/installations/GoogleService-Info.plist
  163. - name: Build objc quickstart
  164. run: scripts/third_party/travis/retry.sh scripts/test_quickstart_ftl.sh Installations
  165. - name: Build swift quickstart
  166. run: scripts/third_party/travis/retry.sh scripts/test_quickstart_ftl.sh Installations swift
  167. - id: ftl_test
  168. uses: FirebaseExtended/github-actions/firebase-test-lab@v1.4
  169. with:
  170. credentials_json: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CREDENTIALS }}
  171. testapp_dir: quickstart-ios/build-for-testing
  172. test_type: "xctest"
  173. installations-cron-only:
  174. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  175. runs-on: macos-14
  176. env:
  177. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  178. FIR_IID_INTEGRATION_TESTS_REQUIRED: ${{ secrets.GHASecretsGPGPassphrase1 }}
  179. strategy:
  180. matrix:
  181. target: [ios, tvos, macos]
  182. flags: [
  183. '--use-static-frameworks'
  184. ]
  185. needs: pod-lib-lint
  186. steps:
  187. - uses: actions/checkout@v4
  188. - uses: ruby/setup-ruby@v1
  189. - name: Setup Bundler
  190. run: scripts/setup_bundler.sh
  191. - name: Configure test keychain
  192. run: scripts/configure_test_keychain.sh
  193. - name: Install GoogleService-Info.plist
  194. run: |
  195. mkdir -p FirebaseInstallations/Source/Tests/Resources
  196. scripts/decrypt_gha_secret.sh scripts/gha-encrypted/Installations/GoogleService-Info.plist.gpg \
  197. FirebaseInstallations/Source/Tests/Resources/GoogleService-Info.plist "$plist_secret"
  198. - name: Get boolean for secrets available
  199. id: secrets
  200. run: echo "::set-output name=val::$([[ -z $plist_secret ]] && echo "0" || echo "1")"
  201. - name: PodLibLint Installations Cron
  202. run: |
  203. export FIS_INTEGRATION_TESTS_REQUIRED=${{ steps.secrets.outputs.val }}
  204. scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseInstallations.podspec \
  205. --platforms=${{ matrix.target }} ${{ matrix.flags }} \