auth.yml 8.0 KB

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