core.yml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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. os: [macos-14]
  23. xcode: [Xcode_15.2, Xcode_16]
  24. runs-on: ${{ matrix.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.xcode }}.app/Contents/Developer
  32. - name: Build and test
  33. run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseCore.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
  71. target: iOS
  72. - os: macos-15
  73. xcode: Xcode_16
  74. target: tvOS
  75. - os: macos-15
  76. xcode: Xcode_16
  77. target: macOS
  78. - os: macos-15
  79. xcode: Xcode_16
  80. target: watchOS
  81. - os: macos-15
  82. xcode: Xcode_16
  83. target: catalyst
  84. - os: macos-15
  85. xcode: Xcode_16
  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: Xcode
  95. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  96. - name: Initialize xcodebuild
  97. run: scripts/setup_spm_tests.sh
  98. - name: Unit Tests
  99. run: scripts/third_party/travis/retry.sh ./scripts/build.sh CoreUnit ${{ 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-13
  104. steps:
  105. - uses: actions/checkout@v4
  106. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  107. with:
  108. cache_key: ${{ matrix.os }}
  109. - uses: ruby/setup-ruby@v1
  110. - name: Setup Bundler
  111. run: scripts/setup_bundler.sh
  112. - name: Setup project and Build Catalyst
  113. run: scripts/test_catalyst.sh FirebaseCore test FirebaseCore-Unit-unit
  114. core-cron-only:
  115. # Don't run on private repo.
  116. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  117. runs-on: macos-13
  118. strategy:
  119. matrix:
  120. target: [ios, tvos, macos]
  121. flags: [
  122. '--use-static-frameworks'
  123. ]
  124. needs: pod-lib-lint
  125. steps:
  126. - uses: actions/checkout@v4
  127. - uses: ruby/setup-ruby@v1
  128. - name: Setup Bundler
  129. run: scripts/setup_bundler.sh
  130. - name: PodLibLint Core Cron
  131. run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseCore.podspec --platforms=${{ matrix.target }} ${{ matrix.flags }}