auth.yml 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  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:
  29. # Flaky tests on CI
  30. - os: macos-13
  31. xcode: Xcode_15.0.1
  32. tests: --skip-tests
  33. runs-on: ${{ matrix.os }}
  34. steps:
  35. - uses: actions/checkout@v4
  36. - uses: ruby/setup-ruby@v1
  37. - name: Setup Bundler
  38. run: scripts/setup_bundler.sh
  39. - name: Configure test keychain
  40. run: scripts/configure_test_keychain.sh
  41. - name: Xcode
  42. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  43. - name: Build and test
  44. run: |
  45. scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb ${{ matrix.podspec }} --platforms=${{ matrix.target }} \
  46. ${{ matrix.tests }}
  47. integration-tests:
  48. # Don't run on private repo unless it is a PR.
  49. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  50. env:
  51. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  52. runs-on: macos-12
  53. steps:
  54. - uses: actions/checkout@v4
  55. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  56. with:
  57. cache_key: ${{ matrix.os }}
  58. - uses: ruby/setup-ruby@v1
  59. - name: Setup Bundler
  60. run: scripts/setup_bundler.sh
  61. - name: Prereqs
  62. run: scripts/install_prereqs.sh Auth iOS
  63. - name: Install Secrets
  64. run: |
  65. scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthCredentials.h.gpg \
  66. FirebaseAuth/Tests/Sample/ApiTests/AuthCredentials.h "$plist_secret"
  67. scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthSample/Application.plist.gpg \
  68. FirebaseAuth/Tests/Sample/Sample/Application.plist "$plist_secret"
  69. scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthSample/AuthCredentials.h.gpg \
  70. FirebaseAuth/Tests/Sample/Sample/AuthCredentials.h "$plist_secret"
  71. scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthSample/GoogleService-Info.plist.gpg \
  72. FirebaseAuth/Tests/Sample/Sample/GoogleService-Info.plist "$plist_secret"
  73. scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthSample/GoogleService-Info_multi.plist.gpg \
  74. FirebaseAuth/Tests/Sample/Sample/GoogleService-Info_multi.plist "$plist_secret"
  75. scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthSample/Sample.entitlements.gpg \
  76. FirebaseAuth/Tests/Sample/Sample/Sample.entitlements "$plist_secret"
  77. scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthSample/Credentials.swift.gpg \
  78. FirebaseAuth/Tests/Sample/SwiftApiTests/Credentials.swift "$plist_secret"
  79. - name: BuildAndTest # can be replaced with pod lib lint with CocoaPods 1.10
  80. run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/build.sh Auth iOS)
  81. spm:
  82. # Don't run on private repo unless it is a PR.
  83. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  84. strategy:
  85. matrix:
  86. target: [iOS, tvOS, macOS, catalyst, watchOS]
  87. os: [macos-12, macos-13]
  88. include:
  89. - os: macos-12
  90. xcode: Xcode_14.2
  91. test: spm
  92. - os: macos-13
  93. xcode: Xcode_15.0.1
  94. test: spmbuildonly
  95. runs-on: ${{ matrix.os }}
  96. steps:
  97. - uses: actions/checkout@v4
  98. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  99. with:
  100. cache_key: ${{ matrix.os }}
  101. - name: Xcode
  102. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  103. - name: Initialize xcodebuild
  104. run: scripts/setup_spm_tests.sh
  105. - name: Unit Tests
  106. run: scripts/third_party/travis/retry.sh ./scripts/build.sh AuthUnit ${{ matrix.target }} ${{ matrix.test }}
  107. catalyst:
  108. # Don't run on private repo unless it is a PR.
  109. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  110. runs-on: macos-12
  111. steps:
  112. - uses: actions/checkout@v4
  113. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  114. with:
  115. cache_key: ${{ matrix.os }}
  116. - uses: ruby/setup-ruby@v1
  117. - name: Setup Bundler
  118. run: scripts/setup_bundler.sh
  119. - name: Setup project and Build for Catalyst
  120. # Only build the unit tests on Catalyst. Their keychain reliance causes several failures.
  121. run: scripts/test_catalyst.sh FirebaseAuth build FirebaseAuth-Unit-unit
  122. quickstart:
  123. # Don't run on private repo unless it is a PR.
  124. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  125. env:
  126. plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  127. signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
  128. runs-on: macos-12
  129. steps:
  130. - uses: actions/checkout@v4
  131. - uses: ruby/setup-ruby@v1
  132. - name: Setup quickstart
  133. run: scripts/setup_quickstart.sh authentication
  134. - name: Install Secret GoogleService-Info.plist
  135. run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-auth.plist.gpg \
  136. quickstart-ios/authentication/GoogleService-Info.plist "$plist_secret"
  137. - name: Test swift quickstart
  138. run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Authentication false)
  139. # TODO(@sunmou99): currently have issue with this job, will re-enable it once the issue resolved.
  140. # quickstart-ftl-cron-only:
  141. # # Don't run on private repo.
  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: Build swift quickstart
  156. # run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart_ftl.sh Authentication)
  157. # - id: ftl_test
  158. # uses: FirebaseExtended/github-actions/firebase-test-lab@v1.2
  159. # with:
  160. # credentials_json: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CREDENTIALS }}
  161. # testapp_dir: quickstart-ios/build-for-testing
  162. # test_type: "xctest"
  163. auth-cron-only:
  164. # Don't run on private repo.
  165. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  166. runs-on: macos-12
  167. strategy:
  168. matrix:
  169. # The macos and tvos tests can hang, and watchOS doesn't have tests.
  170. target: [ios, tvos --skip-tests, macos --skip-tests, watchos --skip-tests]
  171. flags: [
  172. '--use-static-frameworks'
  173. ]
  174. needs: pod-lib-lint
  175. steps:
  176. - uses: actions/checkout@v4
  177. - uses: ruby/setup-ruby@v1
  178. - name: Setup Bundler
  179. run: scripts/setup_bundler.sh
  180. - name: Configure test keychain
  181. run: scripts/configure_test_keychain.sh
  182. - name: PodLibLint Auth Cron
  183. run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseAuth.podspec --platforms=${{ matrix.target }} ${{ matrix.flags }}