auth.yml 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  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-12, macos-13]
  25. include:
  26. - os: macos-12
  27. xcode: Xcode_14.2
  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-12, macos-13, macos-14]
  97. include:
  98. - os: macos-12
  99. xcode: Xcode_14.2
  100. test: spm
  101. - os: macos-13
  102. xcode: Xcode_15.2
  103. test: spmbuildonly
  104. - os: macos-14
  105. xcode: Xcode_15.2
  106. test: spmbuildonly
  107. - os: macos-14
  108. xcode: Xcode_15.2
  109. target: visionOS
  110. test: spm
  111. runs-on: ${{ matrix.os }}
  112. steps:
  113. - uses: actions/checkout@v4
  114. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  115. with:
  116. cache_key: spm${{ matrix.os }}-${{ matrix.xcode }}-${{ matrix.target }}
  117. - name: Xcode
  118. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  119. - name: Initialize xcodebuild
  120. run: scripts/setup_spm_tests.sh
  121. - uses: nick-fields/retry@v3
  122. with:
  123. timeout_minutes: 120
  124. max_attempts: 3
  125. retry_on: error
  126. retry_wait_seconds: 120
  127. command: scripts/third_party/travis/retry.sh ./scripts/build.sh AuthUnit ${{ matrix.target }} ${{ matrix.test }}
  128. catalyst:
  129. # Don't run on private repo unless it is a PR.
  130. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  131. runs-on: macos-12
  132. steps:
  133. - uses: actions/checkout@v4
  134. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  135. with:
  136. cache_key: catalyst${{ matrix.os }}
  137. - uses: ruby/setup-ruby@v1
  138. - name: Setup Bundler
  139. run: scripts/setup_bundler.sh
  140. - uses: nick-fields/retry@v3
  141. with:
  142. timeout_minutes: 120
  143. max_attempts: 3
  144. retry_on: error
  145. retry_wait_seconds: 120
  146. command: scripts/test_catalyst.sh FirebaseAuth build FirebaseAuth-Unit-unit
  147. quickstart:
  148. # Don't run on private repo unless it is a PR.
  149. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  150. env:
  151. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  152. signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  153. runs-on: macos-12
  154. steps:
  155. - uses: actions/checkout@v4
  156. - uses: ruby/setup-ruby@v1
  157. - name: Setup quickstart
  158. run: scripts/setup_quickstart.sh authentication
  159. - name: Install Secret GoogleService-Info.plist
  160. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-auth.plist.gpg \
  161. quickstart-ios/authentication/GoogleService-Info.plist "$plist_secret"
  162. - name: Test swift quickstart
  163. run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Authentication false)
  164. # TODO(@sunmou99): currently have issue with this job, will re-enable it once the issue resolved.
  165. # quickstart-ftl-cron-only:
  166. # # Don't run on private repo.
  167. # if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  168. # env:
  169. # plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  170. # signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  171. # runs-on: macos-12
  172. # steps:
  173. # - uses: actions/checkout@v4
  174. # - uses: ruby/setup-ruby@v1
  175. # - name: Setup quickstart
  176. # run: scripts/setup_quickstart.sh authentication
  177. # - name: Install Secret GoogleService-Info.plist
  178. # run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-auth.plist.gpg \
  179. # quickstart-ios/authentication/GoogleService-Info.plist "$plist_secret"
  180. # - name: Build swift quickstart
  181. # run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart_ftl.sh Authentication)
  182. # - id: ftl_test
  183. # uses: FirebaseExtended/github-actions/firebase-test-lab@v1.2
  184. # with:
  185. # credentials_json: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CREDENTIALS }}
  186. # testapp_dir: quickstart-ios/build-for-testing
  187. # test_type: "xctest"
  188. auth-cron-only:
  189. # Don't run on private repo.
  190. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  191. runs-on: macos-12
  192. strategy:
  193. matrix:
  194. # The macos and tvos tests can hang, and watchOS doesn't have tests.
  195. target: [ios, tvos --skip-tests, macos --skip-tests, watchos --skip-tests]
  196. flags: [
  197. '--use-static-frameworks'
  198. ]
  199. needs: pod-lib-lint
  200. steps:
  201. - uses: actions/checkout@v4
  202. - uses: ruby/setup-ruby@v1
  203. - name: Setup Bundler
  204. run: scripts/setup_bundler.sh
  205. - name: Configure test keychain
  206. run: scripts/configure_test_keychain.sh
  207. - uses: nick-fields/retry@v3
  208. with:
  209. timeout_minutes: 120
  210. max_attempts: 3
  211. retry_on: error
  212. retry_wait_seconds: 120
  213. command: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseAuth.podspec --platforms=${{ matrix.target }} ${{ matrix.flags }}