firebase_app_check.yml 5.6 KB

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