spm.yml 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. name: spm
  2. on:
  3. pull_request:
  4. paths:
  5. - '.github/workflows/spm.yml'
  6. - 'Package.swift'
  7. - '.swiftpm/*'
  8. - 'scripts/build.sh'
  9. - 'SwiftPMTests/*'
  10. - 'SwiftPM-PlatformExclude'
  11. - 'Gemfile*'
  12. schedule:
  13. # Run every day at 12am (PST) - cron uses UTC times
  14. - cron: '0 8 * * *'
  15. # This workflow builds and tests the Swift Package Manager. Only iOS runs on PRs
  16. # because each platform takes 15-20 minutes after adding Firestore.
  17. concurrency:
  18. group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
  19. cancel-in-progress: true
  20. jobs:
  21. swift-build-run:
  22. # Don't run on private repo unless it is a PR.
  23. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  24. strategy:
  25. matrix:
  26. os: [macos-12, macos-13]
  27. include:
  28. - os: macos-12
  29. xcode: Xcode_14.2
  30. test: spm
  31. # The integration tests are slow and flaky on Xcode 15, so just build.
  32. - os: macos-13
  33. xcode: Xcode_15.2
  34. test: spmbuildonly
  35. - os: macos-14
  36. xcode: Xcode_15.2
  37. test: spmbuildonly
  38. runs-on: ${{ matrix.os }}
  39. steps:
  40. - uses: actions/checkout@v4
  41. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  42. with:
  43. cache_key: spm${{ matrix.os }}-${{ matrix.xcode }}-${{ matrix.target }}
  44. - name: Xcode
  45. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  46. - name: Initialize xcodebuild
  47. run: scripts/setup_spm_tests.sh
  48. - name: Functions Integration Test Server
  49. run: FirebaseFunctions/Backend/start.sh synchronous
  50. - name: iOS Unit Tests
  51. run: scripts/third_party/travis/retry.sh ./scripts/build.sh Firebase-Package iOS ${{ matrix.test }}
  52. # Test iOS Device build since some Firestore dependencies build different files.
  53. iOS-Device:
  54. # Don't run on private repo unless it is a PR.
  55. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  56. strategy:
  57. matrix:
  58. os: [macos-12, macos-13]
  59. include:
  60. - os: macos-12
  61. xcode: Xcode_14.2
  62. - os: macos-13
  63. xcode: Xcode_15.2
  64. runs-on: ${{ matrix.os }}
  65. steps:
  66. - uses: actions/checkout@v4
  67. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  68. with:
  69. cache_key: device${{ matrix.os }}${{ matrix.xcode }}
  70. - name: Xcode
  71. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  72. - name: Initialize xcodebuild
  73. run: scripts/setup_spm_tests.sh
  74. - name: iOS Device and Test Build
  75. run: scripts/third_party/travis/retry.sh ./scripts/build.sh Firebase-Package iOS-device spmbuildonly
  76. platforms:
  77. # Don't run on private repo unless it is a PR.
  78. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  79. strategy:
  80. matrix:
  81. # Full set of Firebase-Package tests only run on iOS. Run subset on other platforms.
  82. target: [tvOS, macOS, catalyst]
  83. os: [macos-12, macos-13, macos-14]
  84. include:
  85. - os: macos-12
  86. xcode: Xcode_14.2
  87. - os: macos-13
  88. xcode: Xcode_15.2
  89. - os: macos-14
  90. xcode: Xcode_15.2
  91. - os: macos-14
  92. target: visionOS
  93. xcode: Xcode_15.2
  94. runs-on: ${{ matrix.os }}
  95. steps:
  96. - uses: actions/checkout@v4
  97. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  98. with:
  99. cache_key: platforms${{ matrix.os }}-${{ matrix.xcode }}-${{ matrix.target }}
  100. - name: Xcode
  101. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  102. - name: Initialize xcodebuild
  103. run: scripts/setup_spm_tests.sh
  104. - name: Objc Import Tests
  105. run: scripts/third_party/travis/retry.sh ./scripts/build.sh objc-import-test ${{ matrix.target }} spm
  106. - name: Swift Tests
  107. run: scripts/third_party/travis/retry.sh ./scripts/build.sh swift-test ${{ matrix.target }} spm
  108. - name: Version Tests
  109. run: scripts/third_party/travis/retry.sh ./scripts/build.sh version-test ${{ matrix.target }} spm
  110. - name: Analytics Build Tests
  111. run: scripts/third_party/travis/retry.sh ./scripts/build.sh analytics-import-test ${{ matrix.target }} spm