core_internal.yml 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. name: core_internal
  2. on:
  3. pull_request:
  4. paths:
  5. - 'FirebaseCoreInternal.podspec'
  6. - 'FirebaseCore/Internal/**'
  7. - '.github/workflows/core_internal.yml'
  8. - 'Gemfile*'
  9. schedule:
  10. # Run every day at 2am (PST) - cron uses UTC times
  11. - cron: '0 10 * * *'
  12. jobs:
  13. pod-lib-lint:
  14. # Don't run on private repo unless it is a PR.
  15. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  16. strategy:
  17. matrix:
  18. target: [ios, tvos, macos, watchos]
  19. build-env:
  20. - os: macos-14
  21. xcode: Xcode_15.2
  22. swift_version: 5.9
  23. - os: macos-15
  24. xcode: Xcode_16.2
  25. swift_version: 5.9
  26. - os: macos-15
  27. xcode: Xcode_16.2
  28. swift_version: 6.0
  29. runs-on: ${{ matrix.build-env.os }}
  30. steps:
  31. - uses: actions/checkout@v4
  32. - uses: ruby/setup-ruby@v1
  33. - name: Setup Bundler
  34. run: scripts/setup_bundler.sh
  35. - name: Xcode
  36. run: sudo xcode-select -s /Applications/${{ matrix.build-env.xcode }}.app/Contents/Developer
  37. - name: Set Swift swift_version
  38. run: sed -i "" "s/s.swift_version[[:space:]]*=[[:space:]]*'5.9'/s.swift_version = '${{ matrix.build-env.swift_version }}'/" FirebaseCoreInternal.podspec
  39. - name: Build and test
  40. run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseCoreInternal.podspec --platforms=${{ matrix.target }}
  41. spm-package-resolved:
  42. env:
  43. FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
  44. runs-on: macos-14
  45. outputs:
  46. cache_key: ${{ steps.generate_cache_key.outputs.cache_key }}
  47. steps:
  48. - uses: actions/checkout@v4
  49. - name: Generate Swift Package.resolved
  50. id: swift_package_resolve
  51. run: |
  52. swift package resolve
  53. - name: Generate cache key
  54. id: generate_cache_key
  55. run: |
  56. cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}"
  57. echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT"
  58. - uses: actions/cache/save@v4
  59. id: cache
  60. with:
  61. path: .build
  62. key: ${{ steps.generate_cache_key.outputs.cache_key }}
  63. spm:
  64. # Don't run on private repo unless it is a PR.
  65. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  66. needs: [spm-package-resolved]
  67. strategy:
  68. matrix:
  69. include:
  70. - os: macos-13
  71. xcode: Xcode_15.2
  72. target: iOS
  73. - os: macos-14
  74. xcode: Xcode_15.4
  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-14
  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@v1
  120. - name: Setup Bundler
  121. run: scripts/setup_bundler.sh
  122. - name: Setup Catalyst project and run unit tests
  123. run: scripts/test_catalyst.sh FirebaseCoreInternal test FirebaseCoreInternal-Unit-Unit
  124. - name: Setup Catalyst project and run integration tests
  125. run: scripts/test_catalyst.sh FirebaseCoreInternal test FirebaseCoreInternal-Unit-Integration
  126. core-internal-cron-only:
  127. # Don't run on private repo.
  128. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  129. runs-on: macos-14
  130. strategy:
  131. matrix:
  132. target: [ios, tvos, macos]
  133. flags: [
  134. '--use-static-frameworks'
  135. ]
  136. needs: pod-lib-lint
  137. steps:
  138. - uses: actions/checkout@v4
  139. - uses: ruby/setup-ruby@v1
  140. - name: Setup Bundler
  141. run: scripts/setup_bundler.sh
  142. - name: PodLibLint CoreInternal Cron
  143. run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseCoreInternal.podspec --platforms=${{ matrix.target }} ${{ matrix.flags }}