auth.yml 8.8 KB

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