spm.yml 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. runs-on: macos-12
  25. steps:
  26. - uses: actions/checkout@v3
  27. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  28. with:
  29. cache_key: ${{ matrix.os }}
  30. - name: Initialize xcodebuild
  31. run: scripts/setup_spm_tests.sh
  32. - name: Functions Integration Test Server
  33. run: FirebaseFunctions/Backend/start.sh synchronous
  34. - name: iOS Unit Tests
  35. run: scripts/third_party/travis/retry.sh ./scripts/build.sh Firebase-Package iOS spm
  36. # Test iOS Device build since some Firestore dependencies build different files.
  37. iOS-Device:
  38. # Don't run on private repo unless it is a PR.
  39. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
  40. runs-on: macos-12
  41. steps:
  42. - uses: actions/checkout@v3
  43. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  44. with:
  45. cache_key: ${{ matrix.os }}
  46. - name: Initialize xcodebuild
  47. run: scripts/setup_spm_tests.sh
  48. - name: iOS Device and Test Build
  49. run: scripts/third_party/travis/retry.sh ./scripts/build.sh Firebase-Package iOS-device spmbuildonly
  50. platforms:
  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. runs-on: macos-12
  54. strategy:
  55. matrix:
  56. target: [tvOS, macOS, catalyst]
  57. # Full set of Firebase-Package tests only run on iOS.
  58. steps:
  59. - uses: actions/checkout@v3
  60. - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
  61. with:
  62. cache_key: ${{ matrix.os }}
  63. - name: Initialize xcodebuild
  64. run: scripts/setup_spm_tests.sh
  65. - name: Objc Import Tests
  66. run: scripts/third_party/travis/retry.sh ./scripts/build.sh objc-import-test ${{ matrix.target }} spm
  67. - name: Swift Tests
  68. run: scripts/third_party/travis/retry.sh ./scripts/build.sh swift-test ${{ matrix.target }} spm
  69. - name: Version Tests
  70. run: scripts/third_party/travis/retry.sh ./scripts/build.sh version-test ${{ matrix.target }} spm
  71. - name: Analytics Build Tests
  72. run: scripts/third_party/travis/retry.sh ./scripts/build.sh analytics-import-test ${{ matrix.target }} spm