core.yml 4.6 KB

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