firebase_app_check.yml 5.5 KB

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