auth.yml 8.5 KB

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