installations.yml 7.0 KB

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