installations.yml 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  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=--platforms=${{ 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. target: [iOS, tvOS, macOS, catalyst, watchOS]
  84. os: [macos-14]
  85. xcode: [Xcode_15.2, Xcode_16]
  86. runs-on: ${{ matrix.os }}
  87. steps:
  88. - uses: actions/checkout@v4
  89. - uses: actions/cache/restore@v4
  90. with:
  91. path: .build
  92. key: ${{needs.spm-package-resolved.outputs.cache_key}}
  93. - name: Xcode
  94. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  95. - name: Initialize xcodebuild
  96. run: scripts/setup_spm_tests.sh
  97. - name: Unit Tests
  98. run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseInstallations ${{ matrix.target }} spmbuildonly
  99. catalyst:
  100. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  101. runs-on: macos-14
  102. steps:
  103. - uses: actions/checkout@v4
  104. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  105. with:
  106. cache_key: catalyst${{ matrix.os }}
  107. - uses: ruby/setup-ruby@v1
  108. - name: Setup Bundler
  109. run: scripts/setup_bundler.sh
  110. - name: Setup project and Build for Catalyst
  111. run: scripts/test_catalyst.sh FirebaseInstallations test FirebaseInstallations-Unit-unit
  112. quickstart:
  113. # Don't run on private repo unless it is a PR.
  114. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  115. runs-on: macos-14
  116. steps:
  117. - uses: actions/checkout@v4
  118. - uses: ruby/setup-ruby@v1
  119. - name: Setup quickstart
  120. run: scripts/setup_quickstart.sh installations
  121. - name: Copy mock plist
  122. run: cp quickstart-ios/mock-GoogleService-Info.plist quickstart-ios/installations/GoogleService-Info.plist
  123. - name: Test objc quickstart
  124. run: scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Installations true
  125. - name: Test swift quickstart
  126. run: scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Installations true swift
  127. quickstart-ftl-cron-only:
  128. # Don't run on private repo.
  129. if: github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule'
  130. runs-on: macos-14
  131. steps:
  132. - uses: actions/checkout@v4
  133. - uses: ruby/setup-ruby@v1
  134. - uses: actions/setup-python@v5
  135. with:
  136. python-version: '3.11'
  137. - name: Setup quickstart
  138. run: scripts/setup_quickstart.sh installations
  139. - name: Copy mock plist
  140. run: cp quickstart-ios/mock-GoogleService-Info.plist quickstart-ios/installations/GoogleService-Info.plist
  141. - name: Build objc quickstart
  142. run: scripts/third_party/travis/retry.sh scripts/test_quickstart_ftl.sh Installations
  143. - name: Build swift quickstart
  144. run: scripts/third_party/travis/retry.sh scripts/test_quickstart_ftl.sh Installations swift
  145. - id: ftl_test
  146. uses: FirebaseExtended/github-actions/firebase-test-lab@v1.4
  147. with:
  148. credentials_json: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CREDENTIALS }}
  149. testapp_dir: quickstart-ios/build-for-testing
  150. test_type: "xctest"
  151. installations-cron-only:
  152. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  153. runs-on: macos-14
  154. env:
  155. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  156. FIR_IID_INTEGRATION_TESTS_REQUIRED: ${{ secrets.GHASecretsGPGPassphrase1 }}
  157. strategy:
  158. matrix:
  159. target: [ios, tvos, macos]
  160. flags: [
  161. '--use-static-frameworks'
  162. ]
  163. needs: pod-lib-lint
  164. steps:
  165. - uses: actions/checkout@v4
  166. - uses: ruby/setup-ruby@v1
  167. - name: Setup Bundler
  168. run: scripts/setup_bundler.sh
  169. - name: Configure test keychain
  170. run: scripts/configure_test_keychain.sh
  171. - name: Install GoogleService-Info.plist
  172. run: |
  173. mkdir -p FirebaseInstallations/Source/Tests/Resources
  174. scripts/decrypt_gha_secret.sh scripts/gha-encrypted/Installations/GoogleService-Info.plist.gpg \
  175. FirebaseInstallations/Source/Tests/Resources/GoogleService-Info.plist "$plist_secret"
  176. - name: Get boolean for secrets available
  177. id: secrets
  178. run: echo "::set-output name=val::$([[ -z $plist_secret ]] && echo "0" || echo "1")"
  179. - name: PodLibLint Installations Cron
  180. run: |
  181. export FIS_INTEGRATION_TESTS_REQUIRED=${{ steps.secrets.outputs.val }}
  182. scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseInstallations.podspec \
  183. --platforms=${{ matrix.target }} ${{ matrix.flags }} \