auth.yml 8.7 KB

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