installations.yml 6.9 KB

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