spm.yml 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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.1
  34. test: spmbuildonly
  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. - name: iOS Unit Tests
  48. run: scripts/third_party/travis/retry.sh ./scripts/build.sh Firebase-Package iOS ${{ matrix.test }}
  49. # Test iOS Device build since some Firestore dependencies build different files.
  50. iOS-Device:
  51. # Don't run on private repo unless it is a PR.
  52. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  53. strategy:
  54. matrix:
  55. os: [macos-12, macos-13]
  56. include:
  57. - os: macos-12
  58. xcode: Xcode_14.2
  59. - os: macos-13
  60. xcode: Xcode_15.1
  61. runs-on: ${{ matrix.os }}
  62. steps:
  63. - uses: actions/checkout@v4
  64. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  65. with:
  66. cache_key: device${{ matrix.os }}${{ matrix.xcode }}
  67. - name: Xcode
  68. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  69. - name: Initialize xcodebuild
  70. run: scripts/setup_spm_tests.sh
  71. - name: iOS Device and Test Build
  72. run: scripts/third_party/travis/retry.sh ./scripts/build.sh Firebase-Package iOS-device spmbuildonly
  73. platforms:
  74. # Don't run on private repo unless it is a PR.
  75. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  76. strategy:
  77. matrix:
  78. # Full set of Firebase-Package tests only run on iOS. Run subset on other platforms.
  79. target: [tvOS, macOS, catalyst]
  80. os: [macos-12, macos-13]
  81. include:
  82. - os: macos-12
  83. xcode: Xcode_14.2
  84. - os: macos-13
  85. xcode: Xcode_15.1
  86. runs-on: ${{ matrix.os }}
  87. steps:
  88. - uses: actions/checkout@v4
  89. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  90. with:
  91. cache_key: platforms${{ matrix.os }}-${{ matrix.xcode }}-${{ matrix.target }}
  92. - name: Xcode
  93. run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
  94. - name: Initialize xcodebuild
  95. run: scripts/setup_spm_tests.sh
  96. - name: Objc Import Tests
  97. run: scripts/third_party/travis/retry.sh ./scripts/build.sh objc-import-test ${{ matrix.target }} spm
  98. - name: Swift Tests
  99. run: scripts/third_party/travis/retry.sh ./scripts/build.sh swift-test ${{ matrix.target }} spm
  100. - name: Version Tests
  101. run: scripts/third_party/travis/retry.sh ./scripts/build.sh version-test ${{ matrix.target }} spm
  102. - name: Analytics Build Tests
  103. run: scripts/third_party/travis/retry.sh ./scripts/build.sh analytics-import-test ${{ matrix.target }} spm