installations.yml 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  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. build-env:
  25. - os: macos-14
  26. xcode: Xcode_15.2
  27. test-specs: unit,integration
  28. - os: macos-15
  29. xcode: Xcode_16.1
  30. test-specs: unit
  31. runs-on: ${{ matrix.build-env.os }}
  32. steps:
  33. - uses: actions/checkout@v4
  34. - uses: ruby/setup-ruby@v1
  35. - name: Setup Bundler
  36. run: scripts/setup_bundler.sh
  37. - name: Configure test keychain
  38. run: scripts/configure_test_keychain.sh
  39. - name: Install GoogleService-Info.plist
  40. run: |
  41. mkdir -p FirebaseInstallations/Source/Tests/Resources
  42. scripts/decrypt_gha_secret.sh scripts/gha-encrypted/Installations/GoogleService-Info.plist.gpg \
  43. FirebaseInstallations/Source/Tests/Resources/GoogleService-Info.plist "$plist_secret"
  44. - name: Get boolean for secrets available
  45. id: secrets
  46. run: echo "::set-output name=val::$([[ -z $plist_secret ]] && echo "0" || echo "1")"
  47. - name: Xcode
  48. run: sudo xcode-select -s /Applications/${{ matrix.build-env.xcode }}.app/Contents/Developer
  49. - name: Build and test
  50. run: |
  51. export FIS_INTEGRATION_TESTS_REQUIRED=${{ steps.secrets.outputs.val }}
  52. scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseInstallations.podspec \
  53. --platforms=${{ matrix.target }} --test-specs=${{ matrix.build-env.test-specs }}
  54. spm-package-resolved:
  55. env:
  56. FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
  57. runs-on: macos-14
  58. outputs:
  59. cache_key: ${{ steps.generate_cache_key.outputs.cache_key }}
  60. steps:
  61. - uses: actions/checkout@v4
  62. - name: Generate Swift Package.resolved
  63. id: swift_package_resolve
  64. run: |
  65. swift package resolve
  66. - name: Generate cache key
  67. id: generate_cache_key
  68. run: |
  69. cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}"
  70. echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT"
  71. - uses: actions/cache/save@v4
  72. id: cache
  73. with:
  74. path: .build
  75. key: ${{ steps.generate_cache_key.outputs.cache_key }}
  76. spm:
  77. # Don't run on private repo unless it is a PR.
  78. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  79. needs: [spm-package-resolved]
  80. strategy:
  81. matrix:
  82. include:
  83. - os: macos-13
  84. xcode: Xcode_15.2
  85. target: iOS
  86. - os: macos-14
  87. xcode: Xcode_15.4
  88. target: iOS
  89. - os: macos-15
  90. xcode: Xcode_16.1
  91. target: iOS
  92. - os: macos-15
  93. xcode: Xcode_16.1
  94. target: tvOS
  95. - os: macos-15
  96. xcode: Xcode_16.1
  97. target: macOS
  98. - os: macos-15
  99. xcode: Xcode_16.1
  100. target: watchOS
  101. - os: macos-15
  102. xcode: Xcode_16.1
  103. target: catalyst
  104. - os: macos-15
  105. xcode: Xcode_16.1
  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-14
  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@v1
  129. - name: Setup Bundler
  130. run: scripts/setup_bundler.sh
  131. - name: Setup project and Build for Catalyst
  132. run: scripts/test_catalyst.sh FirebaseInstallations test FirebaseInstallations-Unit-unit
  133. quickstart:
  134. # Don't run on private repo unless it is a PR.
  135. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  136. runs-on: macos-14
  137. steps:
  138. - uses: actions/checkout@v4
  139. - uses: ruby/setup-ruby@v1
  140. - name: Setup quickstart
  141. run: scripts/setup_quickstart.sh installations
  142. - name: Copy mock plist
  143. run: cp quickstart-ios/mock-GoogleService-Info.plist quickstart-ios/installations/GoogleService-Info.plist
  144. - name: Test objc quickstart
  145. run: scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Installations true
  146. - name: Test swift quickstart
  147. run: scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Installations true swift
  148. quickstart-ftl-cron-only:
  149. # Don't run on private repo.
  150. if: github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule'
  151. runs-on: macos-14
  152. steps:
  153. - uses: actions/checkout@v4
  154. - uses: ruby/setup-ruby@v1
  155. - uses: actions/setup-python@v5
  156. with:
  157. python-version: '3.11'
  158. - name: Setup quickstart
  159. run: scripts/setup_quickstart.sh installations
  160. - name: Copy mock plist
  161. run: cp quickstart-ios/mock-GoogleService-Info.plist quickstart-ios/installations/GoogleService-Info.plist
  162. - name: Build objc quickstart
  163. run: scripts/third_party/travis/retry.sh scripts/test_quickstart_ftl.sh Installations
  164. - name: Build swift quickstart
  165. run: scripts/third_party/travis/retry.sh scripts/test_quickstart_ftl.sh Installations swift
  166. - id: ftl_test
  167. uses: FirebaseExtended/github-actions/firebase-test-lab@v1.4
  168. with:
  169. credentials_json: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CREDENTIALS }}
  170. testapp_dir: quickstart-ios/build-for-testing
  171. test_type: "xctest"
  172. installations-cron-only:
  173. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  174. runs-on: macos-14
  175. env:
  176. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  177. FIR_IID_INTEGRATION_TESTS_REQUIRED: ${{ secrets.GHASecretsGPGPassphrase1 }}
  178. strategy:
  179. matrix:
  180. target: [ios, tvos, macos]
  181. flags: [
  182. '--use-static-frameworks'
  183. ]
  184. needs: pod-lib-lint
  185. steps:
  186. - uses: actions/checkout@v4
  187. - uses: ruby/setup-ruby@v1
  188. - name: Setup Bundler
  189. run: scripts/setup_bundler.sh
  190. - name: Configure test keychain
  191. run: scripts/configure_test_keychain.sh
  192. - name: Install GoogleService-Info.plist
  193. run: |
  194. mkdir -p FirebaseInstallations/Source/Tests/Resources
  195. scripts/decrypt_gha_secret.sh scripts/gha-encrypted/Installations/GoogleService-Info.plist.gpg \
  196. FirebaseInstallations/Source/Tests/Resources/GoogleService-Info.plist "$plist_secret"
  197. - name: Get boolean for secrets available
  198. id: secrets
  199. run: echo "::set-output name=val::$([[ -z $plist_secret ]] && echo "0" || echo "1")"
  200. - name: PodLibLint Installations Cron
  201. run: |
  202. export FIS_INTEGRATION_TESTS_REQUIRED=${{ steps.secrets.outputs.val }}
  203. scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseInstallations.podspec \
  204. --platforms=${{ matrix.target }} ${{ matrix.flags }} \