installations.yml 8.7 KB

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