auth.yml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  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-15]
  54. xcode: [Xcode_16.2]
  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. include:
  101. - os: macos-13
  102. xcode: Xcode_15.2
  103. target: iOS spm
  104. - os: macos-14
  105. xcode: Xcode_15.4
  106. target: iOS spm
  107. - os: macos-15
  108. xcode: Xcode_16.2
  109. target: iOS spm
  110. - os: macos-15
  111. xcode: Xcode_16.2
  112. target: tvOS spm
  113. - os: macos-15
  114. xcode: Xcode_16.2
  115. target: macOS spmbuildonly
  116. - os: macos-15
  117. xcode: Xcode_16.2
  118. target: watchOS spm
  119. - os: macos-15
  120. xcode: Xcode_16.2
  121. target: catalyst spm
  122. - os: macos-15
  123. xcode: Xcode_16.2
  124. target: visionOS spm
  125. runs-on: ${{ matrix.os }}
  126. steps:
  127. - uses: actions/checkout@v4
  128. - uses: actions/cache/restore@v4
  129. with:
  130. path: .build
  131. key: ${{needs.spm-package-resolved.outputs.cache_key}}
  132. - name: Xcode
  133. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  134. - name: Install visionOS, if needed.
  135. if: matrix.target == 'visionOS spm'
  136. run: xcodebuild -downloadPlatform visionOS
  137. - name: Initialize xcodebuild
  138. run: scripts/setup_spm_tests.sh
  139. - uses: nick-fields/retry@v3
  140. with:
  141. timeout_minutes: 120
  142. max_attempts: 3
  143. retry_on: error
  144. retry_wait_seconds: 120
  145. command: scripts/third_party/travis/retry.sh ./scripts/build.sh AuthUnit ${{ matrix.target }}
  146. integration-tests:
  147. # Don't run on private repo unless it is a PR.
  148. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  149. needs: [spm-package-resolved]
  150. strategy:
  151. matrix:
  152. scheme: [ObjCApiTests, SwiftApiTests, AuthenticationExampleUITests]
  153. env:
  154. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  155. FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
  156. runs-on: macos-15
  157. steps:
  158. - uses: actions/checkout@v4
  159. - uses: actions/cache/restore@v4
  160. with:
  161. path: .build
  162. key: ${{needs.spm-package-resolved.outputs.cache_key}}
  163. - name: Install Secrets
  164. run: |
  165. scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthCredentials.h.gpg \
  166. FirebaseAuth/Tests/SampleSwift/ObjCApiTests/AuthCredentials.h "$plist_secret"
  167. scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthSample/SwiftApplication.plist.gpg \
  168. FirebaseAuth/Tests/SampleSwift/AuthenticationExample/SwiftApplication.plist "$plist_secret"
  169. scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthSample/AuthCredentials.h.gpg \
  170. FirebaseAuth/Tests/SampleSwift/AuthCredentials.h "$plist_secret"
  171. scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthSample/GoogleService-Info.plist.gpg \
  172. FirebaseAuth/Tests/SampleSwift/GoogleService-Info.plist "$plist_secret"
  173. scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthSample/GoogleService-Info_multi.plist.gpg \
  174. FirebaseAuth/Tests/SampleSwift/GoogleService-Info_multi.plist "$plist_secret"
  175. scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthSample/Sample.entitlements.gpg \
  176. FirebaseAuth/Tests/SampleSwift/Sample.entitlements "$plist_secret"
  177. scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthSample/Credentials.swift.gpg \
  178. FirebaseAuth/Tests/SampleSwift/SwiftApiTests/Credentials.swift "$plist_secret"
  179. - name: Xcode
  180. run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
  181. - uses: nick-fields/retry@v3
  182. with:
  183. timeout_minutes: 120
  184. max_attempts: 3
  185. retry_on: error
  186. retry_wait_seconds: 120
  187. command: ([ -z $plist_secret ] || scripts/build.sh Auth iOS ${{ matrix.scheme }})
  188. catalyst:
  189. # Don't run on private repo unless it is a PR.
  190. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  191. runs-on: macos-14
  192. steps:
  193. - uses: actions/checkout@v4
  194. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  195. with:
  196. cache_key: catalyst${{ matrix.os }}
  197. - uses: ruby/setup-ruby@v1
  198. - name: Setup Bundler
  199. run: scripts/setup_bundler.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/test_catalyst.sh FirebaseAuth build FirebaseAuth-Unit-unit
  207. quickstart:
  208. # Don't run on private repo unless it is a PR.
  209. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  210. env:
  211. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  212. signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  213. runs-on: macos-15
  214. steps:
  215. - uses: actions/checkout@v4
  216. - uses: ruby/setup-ruby@v1
  217. - name: Setup quickstart
  218. run: scripts/setup_quickstart.sh authentication
  219. - name: Install Secret GoogleService-Info.plist
  220. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-auth.plist.gpg \
  221. quickstart-ios/authentication/GoogleService-Info.plist "$plist_secret"
  222. - name: Test swift quickstart
  223. run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Authentication false)
  224. # TODO(@sunmou99): currently have issue with this job, will re-enable it once the issue resolved.
  225. # quickstart-ftl-cron-only:
  226. # # Don't run on private repo.
  227. # if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  228. # env:
  229. # plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  230. # signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  231. # runs-on: macos-14
  232. # steps:
  233. # - uses: actions/checkout@v4
  234. # - uses: ruby/setup-ruby@v1
  235. # - uses: actions/setup-python@v5
  236. # with:
  237. # python-version: '3.11'
  238. # - name: Setup quickstart
  239. # run: scripts/setup_quickstart.sh authentication
  240. # - name: Install Secret GoogleService-Info.plist
  241. # run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-auth.plist.gpg \
  242. # quickstart-ios/authentication/GoogleService-Info.plist "$plist_secret"
  243. # - name: Build swift quickstart
  244. # run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart_ftl.sh Authentication)
  245. # - id: ftl_test
  246. # uses: FirebaseExtended/github-actions/firebase-test-lab@v1.4
  247. # with:
  248. # credentials_json: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CREDENTIALS }}
  249. # testapp_dir: quickstart-ios/build-for-testing
  250. # test_type: "xctest"
  251. auth-cron-only:
  252. # Don't run on private repo.
  253. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  254. runs-on: macos-14
  255. strategy:
  256. matrix:
  257. # The macos and tvos tests can hang, and watchOS doesn't have tests.
  258. target: [ios, tvos --skip-tests, macos --skip-tests, watchos --skip-tests]
  259. flags: [
  260. '--use-static-frameworks'
  261. ]
  262. needs: pod-lib-lint
  263. steps:
  264. - uses: actions/checkout@v4
  265. - uses: ruby/setup-ruby@v1
  266. - name: Setup Bundler
  267. run: scripts/setup_bundler.sh
  268. - name: Configure test keychain
  269. run: scripts/configure_test_keychain.sh
  270. - uses: nick-fields/retry@v3
  271. with:
  272. timeout_minutes: 120
  273. max_attempts: 3
  274. retry_on: error
  275. retry_wait_seconds: 120
  276. command: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseAuth.podspec --platforms=${{ matrix.target }} ${{ matrix.flags }}