core_internal.yml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. name: core_internal
  2. on:
  3. workflow_dispatch:
  4. pull_request:
  5. paths:
  6. - 'FirebaseCoreInternal.podspec'
  7. - 'FirebaseCore/Internal/**'
  8. - '.github/workflows/core_internal.yml'
  9. - 'Gemfile*'
  10. schedule:
  11. # Run every day at 2am (PST) - cron uses UTC times
  12. - cron: '0 10 * * *'
  13. jobs:
  14. pod-lib-lint:
  15. # Don't run on private repo unless it is a PR.
  16. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  17. strategy:
  18. matrix:
  19. target: [ios, tvos, macos, watchos]
  20. build-env:
  21. - os: macos-14
  22. xcode: Xcode_16.2
  23. swift_version: 5.9
  24. - os: macos-15
  25. xcode: Xcode_16.2
  26. swift_version: 5.9
  27. - os: macos-15
  28. xcode: Xcode_16.2
  29. swift_version: 6.0
  30. runs-on: ${{ matrix.build-env.os }}
  31. steps:
  32. - uses: actions/checkout@v4
  33. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  34. - name: Setup Bundler
  35. run: scripts/setup_bundler.sh
  36. - name: Xcode
  37. run: sudo xcode-select -s /Applications/${{ matrix.build-env.xcode }}.app/Contents/Developer
  38. - name: Set Swift swift_version
  39. run: sed -i "" "s/s.swift_version[[:space:]]*=[[:space:]]*'5.9'/s.swift_version = '${{ matrix.build-env.swift_version }}'/" FirebaseCoreInternal.podspec
  40. - name: Build and test
  41. run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseCoreInternal.podspec --platforms=${{ matrix.target }}
  42. spm-package-resolved:
  43. env:
  44. FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
  45. runs-on: macos-14
  46. outputs:
  47. cache_key: ${{ steps.generate_cache_key.outputs.cache_key }}
  48. steps:
  49. - uses: actions/checkout@v4
  50. - name: Xcode
  51. run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
  52. - name: Generate Swift Package.resolved
  53. id: swift_package_resolve
  54. run: |
  55. swift package resolve
  56. - name: Generate cache key
  57. id: generate_cache_key
  58. run: |
  59. cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}"
  60. echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT"
  61. - uses: actions/cache/save@v4
  62. id: cache
  63. with:
  64. path: .build
  65. key: ${{ steps.generate_cache_key.outputs.cache_key }}
  66. spm:
  67. # Don't run on private repo unless it is a PR.
  68. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  69. needs: [spm-package-resolved]
  70. strategy:
  71. matrix:
  72. include:
  73. - os: macos-14
  74. xcode: Xcode_16.2
  75. target: iOS
  76. - os: macos-15
  77. xcode: Xcode_16.2
  78. target: iOS
  79. - os: macos-15
  80. xcode: Xcode_16.2
  81. target: tvOS
  82. - os: macos-15
  83. xcode: Xcode_16.2
  84. target: macOS
  85. - os: macos-15
  86. xcode: Xcode_16.2
  87. target: watchOS
  88. - os: macos-15
  89. xcode: Xcode_16.2
  90. target: catalyst
  91. - os: macos-15
  92. xcode: Xcode_16.2
  93. target: visionOS
  94. runs-on: ${{ matrix.os }}
  95. steps:
  96. - uses: actions/checkout@v4
  97. - uses: actions/cache/restore@v4
  98. with:
  99. path: .build
  100. key: ${{needs.spm-package-resolved.outputs.cache_key}}
  101. - name: Initialize xcodebuild
  102. run: scripts/setup_spm_tests.sh
  103. - name: Xcode
  104. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  105. - name: Install visionOS, if needed.
  106. if: matrix.target == 'visionOS'
  107. run: xcodebuild -downloadPlatform visionOS
  108. - name: FirebaseCoreInternalTests
  109. run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseCoreInternalTests ${{ matrix.target }} spm
  110. catalyst:
  111. # Don't run on private repo unless it is a PR.
  112. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  113. runs-on: macos-15
  114. steps:
  115. - uses: actions/checkout@v4
  116. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  117. with:
  118. cache_key: catalyst${{ matrix.os }}
  119. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  120. - name: Setup Bundler
  121. run: scripts/setup_bundler.sh
  122. - name: Xcode
  123. run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
  124. - name: Setup Catalyst project and run unit tests
  125. run: scripts/test_catalyst.sh FirebaseCoreInternal test FirebaseCoreInternal-Unit-Unit
  126. - name: Setup Catalyst project and run integration tests
  127. run: scripts/test_catalyst.sh FirebaseCoreInternal test FirebaseCoreInternal-Unit-Integration
  128. core-internal-cron-only:
  129. # Don't run on private repo.
  130. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  131. runs-on: macos-15
  132. strategy:
  133. matrix:
  134. target: [ios, tvos, macos]
  135. flags: [
  136. '--use-static-frameworks'
  137. ]
  138. needs: pod-lib-lint
  139. steps:
  140. - uses: actions/checkout@v4
  141. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  142. - name: Xcode
  143. run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
  144. - name: Setup Bundler
  145. run: scripts/setup_bundler.sh
  146. - name: PodLibLint CoreInternal Cron
  147. run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseCoreInternal.podspec --platforms=${{ matrix.target }} ${{ matrix.flags }}