core.yml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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. spm:
  17. uses: ./.github/workflows/common.yml
  18. with:
  19. target: CoreUnit
  20. catalyst:
  21. uses: ./.github/workflows/common_catalyst.yml
  22. with:
  23. product: FirebaseCore
  24. target: FirebaseCore-Unit-unit
  25. pod-lib-lint:
  26. # Don't run on private repo unless it is a PR.
  27. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  28. strategy:
  29. matrix:
  30. # TODO: macos tests are blocked by https://github.com/erikdoe/ocmock/pull/532
  31. target: [ios, tvos, macos --skip-tests, watchos]
  32. build-env:
  33. - os: macos-14
  34. xcode: Xcode_16.2
  35. - os: macos-15
  36. xcode: Xcode_16.2
  37. # TODO: Add Xcode matrix when Xcode 16 is ubiquitous on CI runners.
  38. # - os: macos-15
  39. # xcode: Xcode_16.3
  40. runs-on: ${{ matrix.build-env.os }}
  41. steps:
  42. - uses: actions/checkout@v4
  43. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  44. - name: Setup Bundler
  45. run: scripts/setup_bundler.sh
  46. - name: Xcode
  47. run: sudo xcode-select -s /Applications/${{ matrix.build-env.xcode }}.app/Contents/Developer
  48. - name: Build and test
  49. run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseCore.podspec --platforms=${{ matrix.target }}
  50. spm-package-resolved:
  51. env:
  52. FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
  53. runs-on: macos-15
  54. outputs:
  55. cache_key: ${{ steps.generate_cache_key.outputs.cache_key }}
  56. steps:
  57. - uses: actions/checkout@v4
  58. - name: Xcode
  59. run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
  60. - name: Generate Swift Package.resolved
  61. id: swift_package_resolve
  62. run: |
  63. swift package resolve
  64. - name: Generate cache key
  65. id: generate_cache_key
  66. run: |
  67. cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}"
  68. echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT"
  69. - uses: actions/cache/save@v4
  70. id: cache
  71. with:
  72. path: .build
  73. key: ${{ steps.generate_cache_key.outputs.cache_key }}
  74. core-cron-only:
  75. # Don't run on private repo.
  76. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  77. runs-on: macos-14
  78. strategy:
  79. matrix:
  80. target: [ios, tvos, macos]
  81. flags: [
  82. '--use-static-frameworks'
  83. ]
  84. needs: pod-lib-lint
  85. steps:
  86. - uses: actions/checkout@v4
  87. - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
  88. - name: Xcode
  89. run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
  90. - name: Setup Bundler
  91. run: scripts/setup_bundler.sh
  92. - name: PodLibLint Core Cron
  93. run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseCore.podspec --platforms=${{ matrix.target }} ${{ matrix.flags }}