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-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: Xcode
  42. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  43. - name: Initialize xcodebuild
  44. run: scripts/setup_spm_tests.sh
  45. - name: Functions Integration Test Server
  46. run: FirebaseFunctions/Backend/start.sh synchronous
  47. - uses: nick-fields/retry@v3
  48. with:
  49. timeout_minutes: 120
  50. max_attempts: 3
  51. retry_on: error
  52. retry_wait_seconds: 120
  53. command: scripts/build.sh Firebase-Package iOS ${{ matrix.test }}
  54. # Test iOS Device build since some Firestore dependencies build different files.
  55. iOS-Device:
  56. # Don't run on private repo unless it is a PR.
  57. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  58. strategy:
  59. matrix:
  60. os: [macos-14, macos-13]
  61. include:
  62. - os: macos-14
  63. xcode: Xcode_15.3
  64. - os: macos-13
  65. xcode: Xcode_15.2
  66. runs-on: ${{ matrix.os }}
  67. steps:
  68. - uses: actions/checkout@v4
  69. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  70. with:
  71. cache_key: device${{ matrix.os }}${{ matrix.xcode }}
  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: iOS Device and Test Build
  77. run: scripts/third_party/travis/retry.sh ./scripts/build.sh Firebase-Package iOS-device spmbuildonly
  78. platforms:
  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. strategy:
  82. matrix:
  83. # Full set of Firebase-Package tests only run on iOS. Run subset on other platforms.
  84. target: [tvOS, macOS, catalyst]
  85. os: [macos-13, macos-14]
  86. include:
  87. - os: macos-13
  88. xcode: Xcode_15.2
  89. - os: macos-14
  90. xcode: Xcode_15.3
  91. - os: macos-14
  92. target: visionOS
  93. xcode: Xcode_15.3
  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