core_internal.yml 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  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. - os: macos-15
  23. xcode: Xcode_16.1
  24. runs-on: ${{ matrix.build-env.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: Xcode
  31. run: sudo xcode-select -s /Applications/${{ matrix.build-env.xcode }}.app/Contents/Developer
  32. - name: Build and test
  33. run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseCoreInternal.podspec --platforms=${{ matrix.target }}
  34. spm-package-resolved:
  35. env:
  36. FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
  37. runs-on: macos-14
  38. outputs:
  39. cache_key: ${{ steps.generate_cache_key.outputs.cache_key }}
  40. steps:
  41. - uses: actions/checkout@v4
  42. - name: Generate Swift Package.resolved
  43. id: swift_package_resolve
  44. run: |
  45. swift package resolve
  46. - name: Generate cache key
  47. id: generate_cache_key
  48. run: |
  49. cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}"
  50. echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT"
  51. - uses: actions/cache/save@v4
  52. id: cache
  53. with:
  54. path: .build
  55. key: ${{ steps.generate_cache_key.outputs.cache_key }}
  56. spm:
  57. # Don't run on private repo unless it is a PR.
  58. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  59. needs: [spm-package-resolved]
  60. strategy:
  61. matrix:
  62. include:
  63. - os: macos-13
  64. xcode: Xcode_15.2
  65. target: iOS
  66. - os: macos-14
  67. xcode: Xcode_15.4
  68. target: iOS
  69. - os: macos-15
  70. xcode: Xcode_16.1
  71. target: iOS
  72. - os: macos-15
  73. xcode: Xcode_16.1
  74. target: tvOS
  75. - os: macos-15
  76. xcode: Xcode_16.1
  77. target: macOS
  78. - os: macos-15
  79. xcode: Xcode_16.1
  80. target: watchOS
  81. - os: macos-15
  82. xcode: Xcode_16.1
  83. target: catalyst
  84. - os: macos-15
  85. xcode: Xcode_16.1
  86. target: visionOS
  87. runs-on: ${{ matrix.os }}
  88. steps:
  89. - uses: actions/checkout@v4
  90. - uses: actions/cache/restore@v4
  91. with:
  92. path: .build
  93. key: ${{needs.spm-package-resolved.outputs.cache_key}}
  94. - name: Initialize xcodebuild
  95. run: scripts/setup_spm_tests.sh
  96. - name: Xcode
  97. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  98. - name: FirebaseCoreInternalTests
  99. run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseCoreInternalTests ${{ matrix.target }} spm
  100. catalyst:
  101. # Don't run on private repo unless it is a PR.
  102. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  103. runs-on: macos-14
  104. steps:
  105. - uses: actions/checkout@v4
  106. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  107. with:
  108. cache_key: catalyst${{ matrix.os }}
  109. - uses: ruby/setup-ruby@v1
  110. - name: Setup Bundler
  111. run: scripts/setup_bundler.sh
  112. - name: Setup Catalyst project and run unit tests
  113. run: scripts/test_catalyst.sh FirebaseCoreInternal test FirebaseCoreInternal-Unit-Unit
  114. - name: Setup Catalyst project and run integration tests
  115. run: scripts/test_catalyst.sh FirebaseCoreInternal test FirebaseCoreInternal-Unit-Integration
  116. core-internal-cron-only:
  117. # Don't run on private repo.
  118. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  119. runs-on: macos-14
  120. strategy:
  121. matrix:
  122. target: [ios, tvos, macos]
  123. flags: [
  124. '--use-static-frameworks'
  125. ]
  126. needs: pod-lib-lint
  127. steps:
  128. - uses: actions/checkout@v4
  129. - uses: ruby/setup-ruby@v1
  130. - name: Setup Bundler
  131. run: scripts/setup_bundler.sh
  132. - name: PodLibLint CoreInternal Cron
  133. run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseCoreInternal.podspec --platforms=${{ matrix.target }} ${{ matrix.flags }}