auth.yml 10 KB

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