installations.yml 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  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, macos-13]
  25. include:
  26. - os: macos-14
  27. xcode: Xcode_15.3
  28. test-specs: unit,integration
  29. - os: macos-13
  30. xcode: Xcode_15.2
  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:
  56. # Don't run on private repo unless it is a PR.
  57. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  58. strategy:
  59. matrix:
  60. # TODO: macos tests are blocked by https://github.com/erikdoe/ocmock/pull/532
  61. target: [iOS, tvOS, macOS, watchOS, catalyst]
  62. os: [macos-13, macos-14]
  63. include:
  64. - os: macos-13
  65. xcode: Xcode_15.2
  66. - os: macos-14
  67. xcode: Xcode_15.3
  68. - os: macos-14
  69. xcode: Xcode_15.3
  70. target: visionOS
  71. runs-on: ${{ matrix.os }}
  72. steps:
  73. - uses: actions/checkout@v4
  74. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  75. with:
  76. cache_key: spm${{ matrix.os }}-${{ matrix.xcode }}-${{ matrix.target }}
  77. - name: Xcode
  78. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  79. - name: Initialize xcodebuild
  80. run: scripts/setup_spm_tests.sh
  81. - name: Unit Tests
  82. run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseInstallations ${{ matrix.target }} spmbuildonly
  83. catalyst:
  84. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  85. runs-on: macos-14
  86. steps:
  87. - uses: actions/checkout@v4
  88. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  89. with:
  90. cache_key: catalyst${{ matrix.os }}
  91. - uses: ruby/setup-ruby@v1
  92. - name: Setup Bundler
  93. run: scripts/setup_bundler.sh
  94. - name: Setup project and Build for Catalyst
  95. run: scripts/test_catalyst.sh FirebaseInstallations test FirebaseInstallations-Unit-unit
  96. quickstart:
  97. # Don't run on private repo unless it is a PR.
  98. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  99. runs-on: macos-14
  100. steps:
  101. - uses: actions/checkout@v4
  102. - uses: ruby/setup-ruby@v1
  103. - name: Setup quickstart
  104. run: scripts/setup_quickstart.sh installations
  105. - name: Copy mock plist
  106. run: cp quickstart-ios/mock-GoogleService-Info.plist quickstart-ios/installations/GoogleService-Info.plist
  107. - name: Test objc quickstart
  108. run: scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Installations true
  109. - name: Test swift quickstart
  110. run: scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Installations true swift
  111. quickstart-ftl-cron-only:
  112. # Don't run on private repo.
  113. if: github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule'
  114. runs-on: macos-14
  115. steps:
  116. - uses: actions/checkout@v4
  117. - uses: ruby/setup-ruby@v1
  118. - uses: actions/setup-python@v4
  119. with:
  120. python-version: '3.11'
  121. - name: Setup quickstart
  122. run: scripts/setup_quickstart.sh installations
  123. - name: Copy mock plist
  124. run: cp quickstart-ios/mock-GoogleService-Info.plist quickstart-ios/installations/GoogleService-Info.plist
  125. - name: Build objc quickstart
  126. run: scripts/third_party/travis/retry.sh scripts/test_quickstart_ftl.sh Installations
  127. - name: Build swift quickstart
  128. run: scripts/third_party/travis/retry.sh scripts/test_quickstart_ftl.sh Installations swift
  129. - id: ftl_test
  130. uses: FirebaseExtended/github-actions/firebase-test-lab@v1.4
  131. with:
  132. credentials_json: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CREDENTIALS }}
  133. testapp_dir: quickstart-ios/build-for-testing
  134. test_type: "xctest"
  135. installations-cron-only:
  136. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  137. runs-on: macos-14
  138. env:
  139. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  140. FIR_IID_INTEGRATION_TESTS_REQUIRED: ${{ secrets.GHASecretsGPGPassphrase1 }}
  141. strategy:
  142. matrix:
  143. target: [ios, tvos, macos]
  144. flags: [
  145. '--use-static-frameworks'
  146. ]
  147. needs: pod-lib-lint
  148. steps:
  149. - uses: actions/checkout@v4
  150. - uses: ruby/setup-ruby@v1
  151. - name: Setup Bundler
  152. run: scripts/setup_bundler.sh
  153. - name: Configure test keychain
  154. run: scripts/configure_test_keychain.sh
  155. - name: Install GoogleService-Info.plist
  156. run: |
  157. mkdir -p FirebaseInstallations/Source/Tests/Resources
  158. scripts/decrypt_gha_secret.sh scripts/gha-encrypted/Installations/GoogleService-Info.plist.gpg \
  159. FirebaseInstallations/Source/Tests/Resources/GoogleService-Info.plist "$plist_secret"
  160. - name: Get boolean for secrets available
  161. id: secrets
  162. run: echo "::set-output name=val::$([[ -z $plist_secret ]] && echo "0" || echo "1")"
  163. - name: PodLibLint Installations Cron
  164. run: |
  165. export FIS_INTEGRATION_TESTS_REQUIRED=${{ steps.secrets.outputs.val }}
  166. scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseInstallations.podspec \
  167. --platforms=${{ matrix.target }} ${{ matrix.flags }} \