firebase_app_check.yml 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. name: firebase_app_check
  2. on:
  3. workflow_dispatch:
  4. pull_request:
  5. paths:
  6. - 'FirebaseAppCheck**'
  7. - '.github/workflows/firebase_app_check.yml'
  8. - 'Gemfile*'
  9. schedule:
  10. # Run every day at 11pm (PST) - cron uses UTC times
  11. - cron: '0 7 * * *'
  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: [FirebaseAppCheckInterop.podspec, FirebaseAppCheck.podspec]
  22. target: [ios, tvos, macos --skip-tests, watchos]
  23. build-env:
  24. - os: macos-14
  25. xcode: Xcode_16.2
  26. - os: macos-15
  27. xcode: Xcode_16.2
  28. runs-on: ${{ matrix.build-env.os }}
  29. steps:
  30. - uses: actions/checkout@v4
  31. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  32. - name: Setup Bundler
  33. run: scripts/setup_bundler.sh
  34. - name: Configure test keychain
  35. run: scripts/configure_test_keychain.sh
  36. - name: Xcode
  37. run: sudo xcode-select -s /Applications/${{ matrix.build-env.xcode }}.app/Contents/Developer
  38. - name: FirebaseAppCheck
  39. run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb ${{ matrix.podspec }} --platforms=${{ matrix.target }}
  40. catalyst:
  41. # Don't run on private repo unless it is a PR.
  42. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  43. runs-on: macos-15
  44. steps:
  45. - uses: actions/checkout@v4
  46. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  47. - name: Setup Bundler
  48. run: scripts/setup_bundler.sh
  49. - name: Xcode
  50. run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
  51. - name: Setup project and Build for Catalyst
  52. run: scripts/test_catalyst.sh FirebaseAppCheck test FirebaseAppCheck-Unit-unit
  53. diagnostics:
  54. # Don't run on private repo unless it is a PR.
  55. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  56. runs-on: macos-15
  57. strategy:
  58. matrix:
  59. diagnostic: [tsan, asan, ubsan]
  60. steps:
  61. - uses: actions/checkout@v4
  62. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  63. with:
  64. cache_key: ${{ matrix.diagnostics }}
  65. - name: Xcode
  66. run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
  67. - name: Initialize xcodebuild
  68. run: scripts/setup_spm_tests.sh
  69. - name: iOS Unit Tests
  70. run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseAppCheckUnit iOS spm ${{ matrix.diagnostic }}
  71. - name: Upload raw logs if failed
  72. if: ${{ failure() }}
  73. uses: actions/upload-artifact@v4
  74. with:
  75. name: failure-xcodebuild-raw-logs
  76. path: xcodebuild.log
  77. app_check-cron-only:
  78. # Don't run on private repo.
  79. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  80. runs-on: macos-15
  81. strategy:
  82. matrix:
  83. flags: [
  84. '--skip-tests --use-modular-headers'
  85. ]
  86. needs: pod_lib_lint
  87. steps:
  88. - uses: actions/checkout@v4
  89. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  90. - name: Xcode
  91. run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
  92. - name: Setup Bundler
  93. run: scripts/setup_bundler.sh
  94. - name: PodLibLint FirebaseAppCheck Cron
  95. # TODO: Remove --allow-warnings when stabilized.
  96. run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseAppCheck.podspec --platforms=ios ${{ matrix.flags }}
  97. spm-package-resolved:
  98. env:
  99. FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
  100. runs-on: macos-14
  101. outputs:
  102. cache_key: ${{ steps.generate_cache_key.outputs.cache_key }}
  103. steps:
  104. - uses: actions/checkout@v4
  105. - name: Xcode
  106. run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
  107. - name: Generate Swift Package.resolved
  108. id: swift_package_resolve
  109. run: |
  110. swift package resolve
  111. - name: Generate cache key
  112. id: generate_cache_key
  113. run: |
  114. cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}"
  115. echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT"
  116. - uses: actions/cache/save@v4
  117. id: cache
  118. with:
  119. path: .build
  120. key: ${{ steps.generate_cache_key.outputs.cache_key }}
  121. spm:
  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. needs: [spm-package-resolved]
  125. strategy:
  126. matrix:
  127. include:
  128. - os: macos-14
  129. xcode: Xcode_16.2
  130. target: iOS
  131. - os: macos-15
  132. xcode: Xcode_16.2
  133. target: iOS
  134. - os: macos-15
  135. xcode: Xcode_16.2
  136. target: tvOS
  137. - os: macos-15
  138. xcode: Xcode_16.2
  139. target: macOS
  140. - os: macos-15
  141. xcode: Xcode_16.2
  142. target: watchOS
  143. - os: macos-15
  144. xcode: Xcode_16.2
  145. target: catalyst
  146. - os: macos-15
  147. xcode: Xcode_16.2
  148. target: visionOS
  149. runs-on: ${{ matrix.os }}
  150. steps:
  151. - uses: actions/checkout@v4
  152. - uses: actions/cache/restore@v4
  153. with:
  154. path: .build
  155. key: ${{needs.spm-package-resolved.outputs.cache_key}}
  156. - name: Xcode
  157. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  158. - name: Install visionOS, if needed.
  159. if: matrix.target == 'visionOS spm'
  160. run: xcodebuild -downloadPlatform visionOS
  161. - name: Initialize xcodebuild
  162. run: scripts/setup_spm_tests.sh
  163. - name: Unit Tests
  164. run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseAppCheckUnit ${{ matrix.target }} spm
  165. - name: Swift Unit Tests
  166. run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseAppCheckUnitSwift ${{ matrix.target }} spm