auth.yml 7.4 KB

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