auth.yml 8.2 KB

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