auth.yml 7.6 KB

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