auth.yml 6.9 KB

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