auth.yml 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. name: auth
  2. on:
  3. pull_request:
  4. paths:
  5. - 'FirebaseAuth**'
  6. - 'FirebaseAuth/Interop/*.h'
  7. - '.github/workflows/auth.yml'
  8. - 'scripts/gha-encrypted/AuthSample/SwiftApplication.plist.gpg'
  9. - 'Gemfile*'
  10. schedule:
  11. # Run every day at 1am (PST) - cron uses UTC times
  12. - cron: '0 9 * * *'
  13. concurrency:
  14. group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
  15. cancel-in-progress: true
  16. jobs:
  17. pod-lib-lint:
  18. # Don't run on private repo unless it is a PR.
  19. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  20. strategy:
  21. matrix:
  22. podspec: [FirebaseAuthInterop.podspec, FirebaseAuth.podspec]
  23. # TODO: macos tests are blocked by https://github.com/erikdoe/ocmock/pull/532
  24. target: [ios, tvos, macos --skip-tests, watchos]
  25. os: [macos-14, macos-13]
  26. include:
  27. - os: macos-14
  28. xcode: Xcode_15.3
  29. tests: --skip-tests
  30. - os: macos-13
  31. xcode: Xcode_15.2
  32. tests:
  33. runs-on: ${{ matrix.os }}
  34. steps:
  35. - uses: actions/checkout@v4
  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: Xcode
  42. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  43. #TODO: Restore warnings check after resolution of #11693
  44. - uses: nick-fields/retry@v3
  45. with:
  46. timeout_minutes: 120
  47. max_attempts: 3
  48. retry_on: error
  49. retry_wait_seconds: 120
  50. command: scripts/pod_lib_lint.rb ${{ matrix.podspec }} --platforms=${{ matrix.target }} ${{ matrix.tests }} --allow-warnings
  51. integration-tests:
  52. # Don't run on private repo unless it is a PR.
  53. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  54. env:
  55. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  56. FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
  57. runs-on: macos-14
  58. steps:
  59. - uses: actions/checkout@v4
  60. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  61. with:
  62. cache_key: integration-tests${{ matrix.os }}
  63. - name: Install Secrets
  64. run: |
  65. scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthCredentials.h.gpg \
  66. FirebaseAuth/Tests/SampleSwift/ObjCApiTests/AuthCredentials.h "$plist_secret"
  67. scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthSample/SwiftApplication.plist.gpg \
  68. FirebaseAuth/Tests/SampleSwift/SwiftApplication.plist "$plist_secret"
  69. scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthSample/AuthCredentials.h.gpg \
  70. FirebaseAuth/Tests/SampleSwift/AuthCredentials.h "$plist_secret"
  71. scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthSample/GoogleService-Info.plist.gpg \
  72. FirebaseAuth/Tests/SampleSwift/GoogleService-Info.plist "$plist_secret"
  73. scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthSample/GoogleService-Info_multi.plist.gpg \
  74. FirebaseAuth/Tests/SampleSwift/GoogleService-Info_multi.plist "$plist_secret"
  75. scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthSample/Sample.entitlements.gpg \
  76. FirebaseAuth/Tests/SampleSwift/Sample.entitlements "$plist_secret"
  77. scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthSample/Credentials.swift.gpg \
  78. FirebaseAuth/Tests/SampleSwift/SwiftApiTests/Credentials.swift "$plist_secret"
  79. - name: Xcode
  80. run: sudo xcode-select -s /Applications/Xcode_15.3.app/Contents/Developer
  81. - uses: nick-fields/retry@v3
  82. with:
  83. timeout_minutes: 120
  84. max_attempts: 3
  85. retry_on: error
  86. retry_wait_seconds: 120
  87. command: ([ -z $plist_secret ] || scripts/build.sh Auth iOS)
  88. spm:
  89. # Don't run on private repo unless it is a PR.
  90. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  91. strategy:
  92. matrix:
  93. target: [iOS, tvOS, macOS, catalyst, watchOS]
  94. os: [macos-13, macos-14]
  95. include:
  96. - os: macos-13
  97. xcode: Xcode_15.2
  98. test: spmbuildonly
  99. - os: macos-14
  100. xcode: Xcode_15.3
  101. test: spmbuildonly
  102. - os: macos-14
  103. xcode: Xcode_15.3
  104. target: visionOS
  105. test: spm
  106. runs-on: ${{ matrix.os }}
  107. steps:
  108. - uses: actions/checkout@v4
  109. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  110. with:
  111. cache_key: spm${{ matrix.os }}-${{ matrix.xcode }}-${{ matrix.target }}
  112. - name: Xcode
  113. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  114. - name: Initialize xcodebuild
  115. run: scripts/setup_spm_tests.sh
  116. - uses: nick-fields/retry@v3
  117. with:
  118. timeout_minutes: 120
  119. max_attempts: 3
  120. retry_on: error
  121. retry_wait_seconds: 120
  122. command: scripts/third_party/travis/retry.sh ./scripts/build.sh AuthUnit ${{ matrix.target }} ${{ matrix.test }}
  123. catalyst:
  124. # Don't run on private repo unless it is a PR.
  125. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  126. runs-on: macos-14
  127. steps:
  128. - uses: actions/checkout@v4
  129. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  130. with:
  131. cache_key: catalyst${{ matrix.os }}
  132. - uses: ruby/setup-ruby@v1
  133. - name: Setup Bundler
  134. run: scripts/setup_bundler.sh
  135. - uses: nick-fields/retry@v3
  136. with:
  137. timeout_minutes: 120
  138. max_attempts: 3
  139. retry_on: error
  140. retry_wait_seconds: 120
  141. command: scripts/test_catalyst.sh FirebaseAuth build FirebaseAuth-Unit-unit
  142. quickstart:
  143. # Don't run on private repo unless it is a PR.
  144. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  145. env:
  146. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  147. signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  148. runs-on: macos-14
  149. steps:
  150. - uses: actions/checkout@v4
  151. - uses: ruby/setup-ruby@v1
  152. - name: Setup quickstart
  153. run: scripts/setup_quickstart.sh authentication
  154. - name: Install Secret GoogleService-Info.plist
  155. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-auth.plist.gpg \
  156. quickstart-ios/authentication/GoogleService-Info.plist "$plist_secret"
  157. - name: Test swift quickstart
  158. run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Authentication false)
  159. # TODO(@sunmou99): currently have issue with this job, will re-enable it once the issue resolved.
  160. # quickstart-ftl-cron-only:
  161. # # Don't run on private repo.
  162. # if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  163. # env:
  164. # plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  165. # signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  166. # runs-on: macos-14
  167. # steps:
  168. # - uses: actions/checkout@v4
  169. # - uses: ruby/setup-ruby@v1
  170. # - name: Setup quickstart
  171. # run: scripts/setup_quickstart.sh authentication
  172. # - name: Install Secret GoogleService-Info.plist
  173. # run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-auth.plist.gpg \
  174. # quickstart-ios/authentication/GoogleService-Info.plist "$plist_secret"
  175. # - name: Build swift quickstart
  176. # run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart_ftl.sh Authentication)
  177. # - id: ftl_test
  178. # uses: FirebaseExtended/github-actions/firebase-test-lab@v1.2
  179. # with:
  180. # credentials_json: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CREDENTIALS }}
  181. # testapp_dir: quickstart-ios/build-for-testing
  182. # test_type: "xctest"
  183. auth-cron-only:
  184. # Don't run on private repo.
  185. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  186. runs-on: macos-14
  187. strategy:
  188. matrix:
  189. # The macos and tvos tests can hang, and watchOS doesn't have tests.
  190. target: [ios, tvos --skip-tests, macos --skip-tests, watchos --skip-tests]
  191. flags: [
  192. '--use-static-frameworks'
  193. ]
  194. needs: pod-lib-lint
  195. steps:
  196. - uses: actions/checkout@v4
  197. - uses: ruby/setup-ruby@v1
  198. - name: Setup Bundler
  199. run: scripts/setup_bundler.sh
  200. - name: Configure test keychain
  201. run: scripts/configure_test_keychain.sh
  202. - uses: nick-fields/retry@v3
  203. with:
  204. timeout_minutes: 120
  205. max_attempts: 3
  206. retry_on: error
  207. retry_wait_seconds: 120
  208. command: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseAuth.podspec --platforms=${{ matrix.target }} ${{ matrix.flags }}