auth.yml 11 KB

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