core.yml 5.3 KB

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