auth.yml 10 KB

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