spm.yml 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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-14, macos-13]
  27. include:
  28. # The integration tests are slow and flaky on Xcode 15, so just build.
  29. - os: macos-13
  30. xcode: Xcode_15.2
  31. test: spmbuildonly
  32. - os: macos-14
  33. xcode: Xcode_15.3
  34. test: spm
  35. runs-on: ${{ matrix.os }}
  36. steps:
  37. - uses: actions/checkout@v4
  38. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  39. with:
  40. cache_key: spm${{ matrix.os }}-${{ matrix.xcode }}-${{ matrix.target }}
  41. - name: Clone mock responses for Vertex AI unit tests
  42. run: scripts/update_vertexai_responses.sh
  43. - name: Xcode
  44. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  45. - name: Initialize xcodebuild
  46. run: scripts/setup_spm_tests.sh
  47. - name: Functions Integration Test Server
  48. run: FirebaseFunctions/Backend/start.sh synchronous
  49. - uses: nick-fields/retry@v3
  50. with:
  51. timeout_minutes: 120
  52. max_attempts: 3
  53. retry_on: error
  54. retry_wait_seconds: 120
  55. command: scripts/build.sh Firebase-Package iOS ${{ matrix.test }}
  56. # Test iOS Device build since some Firestore dependencies build different files.
  57. iOS-Device:
  58. # Don't run on private repo unless it is a PR.
  59. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  60. strategy:
  61. matrix:
  62. os: [macos-14, macos-13]
  63. include:
  64. - os: macos-14
  65. xcode: Xcode_15.3
  66. - os: macos-13
  67. xcode: Xcode_15.2
  68. runs-on: ${{ matrix.os }}
  69. steps:
  70. - uses: actions/checkout@v4
  71. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  72. with:
  73. cache_key: device${{ matrix.os }}${{ matrix.xcode }}
  74. - name: Clone mock responses for Vertex AI unit tests
  75. run: scripts/update_vertexai_responses.sh
  76. - name: Xcode
  77. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  78. - name: Initialize xcodebuild
  79. run: scripts/setup_spm_tests.sh
  80. - name: iOS Device and Test Build
  81. run: scripts/third_party/travis/retry.sh ./scripts/build.sh Firebase-Package iOS-device spmbuildonly
  82. platforms:
  83. # Don't run on private repo unless it is a PR.
  84. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  85. strategy:
  86. matrix:
  87. # Full set of Firebase-Package tests only run on iOS. Run subset on other platforms.
  88. # visionOS isn't buildable from here (even with Firestore source) because the test
  89. # targets need Analytics.
  90. target: [tvOS, macOS, catalyst]
  91. os: [macos-13, macos-14]
  92. include:
  93. - os: macos-13
  94. xcode: Xcode_15.2
  95. - os: macos-14
  96. xcode: Xcode_15.3
  97. runs-on: ${{ matrix.os }}
  98. steps:
  99. - uses: actions/checkout@v4
  100. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  101. with:
  102. cache_key: platforms${{ matrix.os }}-${{ matrix.xcode }}-${{ matrix.target }}
  103. - name: Xcode
  104. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  105. - name: Initialize xcodebuild
  106. run: scripts/setup_spm_tests.sh
  107. - name: Objc Import Tests
  108. run: scripts/third_party/travis/retry.sh ./scripts/build.sh objc-import-test ${{ matrix.target }} spm
  109. - name: Swift Tests
  110. run: scripts/third_party/travis/retry.sh ./scripts/build.sh swift-test ${{ matrix.target }} spm
  111. - name: Version Tests
  112. run: scripts/third_party/travis/retry.sh ./scripts/build.sh version-test ${{ matrix.target }} spm
  113. - name: Analytics Build Tests
  114. run: scripts/third_party/travis/retry.sh ./scripts/build.sh analytics-import-test ${{ matrix.target }} spm