spm.yml 4.7 KB

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