auth.yml 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  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. runs-on: macos-13
  57. steps:
  58. - uses: actions/checkout@v4
  59. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  60. with:
  61. cache_key: integration-tests${{ matrix.os }}
  62. - name: Install Secrets
  63. run: |
  64. scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthCredentials.h.gpg \
  65. FirebaseAuth/Tests/SampleSwift/ObjCApiTests/AuthCredentials.h "$plist_secret"
  66. scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthSample/SwiftApplication.plist.gpg \
  67. FirebaseAuth/Tests/SampleSwift/SwiftApplication.plist "$plist_secret"
  68. scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthSample/AuthCredentials.h.gpg \
  69. FirebaseAuth/Tests/SampleSwift/AuthCredentials.h "$plist_secret"
  70. scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthSample/GoogleService-Info.plist.gpg \
  71. FirebaseAuth/Tests/SampleSwift/GoogleService-Info.plist "$plist_secret"
  72. scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthSample/GoogleService-Info_multi.plist.gpg \
  73. FirebaseAuth/Tests/SampleSwift/GoogleService-Info_multi.plist "$plist_secret"
  74. scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthSample/Sample.entitlements.gpg \
  75. FirebaseAuth/Tests/SampleSwift/Sample.entitlements "$plist_secret"
  76. scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthSample/Credentials.swift.gpg \
  77. FirebaseAuth/Tests/SampleSwift/SwiftApiTests/Credentials.swift "$plist_secret"
  78. - name: Xcode
  79. run: sudo xcode-select -s /Applications/Xcode_15.2.app/Contents/Developer
  80. - uses: nick-fields/retry@v3
  81. with:
  82. timeout_minutes: 120
  83. max_attempts: 3
  84. retry_on: error
  85. retry_wait_seconds: 120
  86. command: ([ -z $plist_secret ] || scripts/build.sh Auth iOS)
  87. multiplatform-sample:
  88. # Don't run on private repo unless it is a PR.
  89. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  90. env:
  91. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  92. strategy:
  93. matrix:
  94. target: [iOS, macOS, visionOS]
  95. runs-on: macos-14
  96. steps:
  97. - uses: actions/checkout@v4
  98. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  99. with:
  100. cache_key: integration-tests${{ matrix.os }}
  101. - name: Install Secrets
  102. run: |
  103. scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthSample/GoogleService-Info.plist.gpg \
  104. FirebaseAuth/Tests/MultiPlatformSample/GoogleService-Info.plist "$plist_secret"
  105. - name: Xcode
  106. run: sudo xcode-select -s /Applications/Xcode_15.3.app/Contents/Developer
  107. - uses: nick-fields/retry@v3
  108. with:
  109. timeout_minutes: 120
  110. max_attempts: 3
  111. retry_on: error
  112. retry_wait_seconds: 120
  113. command: ([ -z $plist_secret ] || scripts/build.sh Auth ${{ matrix.target }} multiplatform )
  114. spm:
  115. # Don't run on private repo unless it is a PR.
  116. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  117. strategy:
  118. matrix:
  119. target: [iOS, tvOS, macOS, catalyst, watchOS]
  120. os: [macos-13, macos-14]
  121. include:
  122. - os: macos-13
  123. xcode: Xcode_15.2
  124. test: spmbuildonly
  125. - os: macos-14
  126. xcode: Xcode_15.3
  127. test: spmbuildonly
  128. - os: macos-14
  129. xcode: Xcode_15.3
  130. target: visionOS
  131. test: spm
  132. runs-on: ${{ matrix.os }}
  133. steps:
  134. - uses: actions/checkout@v4
  135. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  136. with:
  137. cache_key: spm${{ matrix.os }}-${{ matrix.xcode }}-${{ matrix.target }}
  138. - name: Xcode
  139. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  140. - name: Initialize xcodebuild
  141. run: scripts/setup_spm_tests.sh
  142. - uses: nick-fields/retry@v3
  143. with:
  144. timeout_minutes: 120
  145. max_attempts: 3
  146. retry_on: error
  147. retry_wait_seconds: 120
  148. command: scripts/third_party/travis/retry.sh ./scripts/build.sh AuthUnit ${{ matrix.target }} ${{ matrix.test }}
  149. catalyst:
  150. # Don't run on private repo unless it is a PR.
  151. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  152. runs-on: macos-14
  153. steps:
  154. - uses: actions/checkout@v4
  155. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  156. with:
  157. cache_key: catalyst${{ matrix.os }}
  158. - uses: ruby/setup-ruby@v1
  159. - name: Setup Bundler
  160. run: scripts/setup_bundler.sh
  161. - uses: nick-fields/retry@v3
  162. with:
  163. timeout_minutes: 120
  164. max_attempts: 3
  165. retry_on: error
  166. retry_wait_seconds: 120
  167. command: scripts/test_catalyst.sh FirebaseAuth build FirebaseAuth-Unit-unit
  168. quickstart:
  169. # Don't run on private repo unless it is a PR.
  170. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  171. env:
  172. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  173. signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  174. runs-on: macos-14
  175. steps:
  176. - uses: actions/checkout@v4
  177. - uses: ruby/setup-ruby@v1
  178. - name: Setup quickstart
  179. run: scripts/setup_quickstart.sh authentication
  180. - name: Install Secret GoogleService-Info.plist
  181. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-auth.plist.gpg \
  182. quickstart-ios/authentication/GoogleService-Info.plist "$plist_secret"
  183. - name: Test swift quickstart
  184. run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Authentication false)
  185. # TODO(@sunmou99): currently have issue with this job, will re-enable it once the issue resolved.
  186. # quickstart-ftl-cron-only:
  187. # # Don't run on private repo.
  188. # if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  189. # env:
  190. # plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  191. # signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  192. # runs-on: macos-14
  193. # steps:
  194. # - uses: actions/checkout@v4
  195. # - uses: ruby/setup-ruby@v1
  196. # - name: Setup quickstart
  197. # run: scripts/setup_quickstart.sh authentication
  198. # - name: Install Secret GoogleService-Info.plist
  199. # run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-auth.plist.gpg \
  200. # quickstart-ios/authentication/GoogleService-Info.plist "$plist_secret"
  201. # - name: Build swift quickstart
  202. # run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart_ftl.sh Authentication)
  203. # - id: ftl_test
  204. # uses: FirebaseExtended/github-actions/firebase-test-lab@v1.2
  205. # with:
  206. # credentials_json: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CREDENTIALS }}
  207. # testapp_dir: quickstart-ios/build-for-testing
  208. # test_type: "xctest"
  209. auth-cron-only:
  210. # Don't run on private repo.
  211. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  212. runs-on: macos-14
  213. strategy:
  214. matrix:
  215. # The macos and tvos tests can hang, and watchOS doesn't have tests.
  216. target: [ios, tvos --skip-tests, macos --skip-tests, watchos --skip-tests]
  217. flags: [
  218. '--use-static-frameworks'
  219. ]
  220. needs: pod-lib-lint
  221. steps:
  222. - uses: actions/checkout@v4
  223. - uses: ruby/setup-ruby@v1
  224. - name: Setup Bundler
  225. run: scripts/setup_bundler.sh
  226. - name: Configure test keychain
  227. run: scripts/configure_test_keychain.sh
  228. - uses: nick-fields/retry@v3
  229. with:
  230. timeout_minutes: 120
  231. max_attempts: 3
  232. retry_on: error
  233. retry_wait_seconds: 120
  234. command: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseAuth.podspec --platforms=${{ matrix.target }} ${{ matrix.flags }}