core.yml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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. target: [iOS, tvOS, macOS, catalyst, watchOS]
  63. os: [macos-14]
  64. xcode: [Xcode_15.2, Xcode_16]
  65. runs-on: ${{ matrix.os }}
  66. steps:
  67. - uses: actions/checkout@v4
  68. - uses: actions/cache/restore@v4
  69. with:
  70. path: .build
  71. key: ${{needs.spm-package-resolved.outputs.cache_key}}
  72. - name: Xcode
  73. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  74. - name: Initialize xcodebuild
  75. run: scripts/setup_spm_tests.sh
  76. - name: Unit Tests
  77. run: scripts/third_party/travis/retry.sh ./scripts/build.sh CoreUnit ${{ matrix.target }} spm
  78. catalyst:
  79. # Don't run on private repo unless it is a PR.
  80. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  81. runs-on: macos-13
  82. steps:
  83. - uses: actions/checkout@v4
  84. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  85. with:
  86. cache_key: ${{ matrix.os }}
  87. - uses: ruby/setup-ruby@v1
  88. - name: Setup Bundler
  89. run: scripts/setup_bundler.sh
  90. - name: Setup project and Build Catalyst
  91. run: scripts/test_catalyst.sh FirebaseCore test FirebaseCore-Unit-unit
  92. core-cron-only:
  93. # Don't run on private repo.
  94. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
  95. runs-on: macos-13
  96. strategy:
  97. matrix:
  98. target: [ios, tvos, macos]
  99. flags: [
  100. '--use-static-frameworks'
  101. ]
  102. needs: pod-lib-lint
  103. steps:
  104. - uses: actions/checkout@v4
  105. - uses: ruby/setup-ruby@v1
  106. - name: Setup Bundler
  107. run: scripts/setup_bundler.sh
  108. - name: PodLibLint Core Cron
  109. run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseCore.podspec --platforms=${{ matrix.target }} ${{ matrix.flags }}